MapBox - GeoCoding
Get GeoJSON Point and Latitude/Longitude from geographic data
The MapBox - GeoCoding tool is used to generate a GeoJSON Point (as a string column) like the one below in addition a range of useful geographic columns that can be used for enriching addresses, places or districts. You can view all the columns below.
You send your data in the form of an address, place, district, etc. into the MapBox - GeoCoding tool and receive a enriched result back. This tool is also built to work with the MapBox - Directions, MapBox - Polygon and Point-in-Polygon tools. The GeoJSON string that this tool outputs can be used as the input for those other tools.
We use MapBox to generate the output of this tool. MapBox has a generous free tier that includes 100.000 monthly requests.
For every row in your dataset you will call a MapBox API. In other words, the tool will take longer time to run with many records. We strongly recommend testing on smaller datasets.
We have built-in restriction to handle rate limits for a single tool. However, you should be cautious if you run multiple models at the same time using the MapBox tool suite.
You are responsible for respecting the Terms of Use specified by MapBox when you use the MapBox - tool.
Configuration
The MapBox - GeoCode tool consists of six required input.
Select Column to Geocode
Select the column you want to geocode. That could be an address, a city, a district, etc. Whatever this column contains should correspond to the type column selected in Step #4 below.
Select Column with Country
Select the column that contains the country that your column in the step above is in. To exemplify, if you want to geocode Paris, this column should be equal to fr.
Your column must in country codes (ISO 3166-1 alpha-2 format). You can find a full list of the appropriate country codes on Wikipedia.
Select ID Column
Select a column containing an ID. Use the Row ID to generate one if you don’t have one in your dataset.
Select Column with Geocode Type
Select a column in your dataset that contains the type of the column you want to geocode in Step #1. If your geocode column from Step #1 contains Paris, the column you select here should probably contain place. You can find a list of geographic features types on MapBox website.
This column could contain either of the below:
- country
- region
- postcode
- district
- place
- locality
- neighborhood
- street
- address
Input MapBox API Token
Input your MapBox API Token.
Input Limit for Returned Records
MapBox can output multiple options if it’s not 100% about which place your looking for. With this input, you can limit how many options MapBox outputs.
MapBox always inputs the most probably options as the first record.
When To Use
The functionality of the MapBox - GeoCoding tool is relatively narrow, but the use cases span wide.
- When you need a longitude and latitude of an address to show in a visualisation tool
- When you need to validate and enrich an address, city, etc. (perhaps you only have a partial address with a missing state)
- When you need input for the MapBox - Directions, MapBox - Polygon and Point-in-Polygon tools