Description


This geocoder allows you to look up a number of locations by name and returns their geographic coordinates.

The following example input:

london
Great Wall of China

returns the following output:

location query latitude longitude type code locality place region country url
london london 51.50722 -0.1275 place 4 St. James's London England United Kingdom https://www.google.com/maps/search/?api=1&query=51.50722,-0.1275
Great Wall of China Great Wall of China 40.416062 116.538709 poi 9 Huairou Qu Beijing Shi China https://www.google.com/maps/search/?api=1&query=40.416062,116.538709

Accuracy code is a number ordered from the most granular to the largest as follows (https://docs.mapbox.com/help/how-mapbox-works/geocoding/#source-data):

Code Type Description
9 poi Points of interest (POI): A named place including commercial businesses, public buildings, monuments, and parks, among other features.
8 address A specific mailing address, including the address number if applicable.
7 neighborhood A colloquial name for a smaller area within a place. Neighborhoods do not necessarily have specific, legally defined boundaries. Only present in some countries.
6 locality An administrative unit that is smaller than a place. Only present in some countries.
5 postcode A geographic area of the address component used for sorting mail.
4 place Cities, towns, and villages. Note that some large cities (such as Tokyo and Istanbul) may be categorized as regions rather than places.
3 district An administrative unit that is larger than a place but smaller than a region. Only present in some countries.
2 region States, provinces, and prefectures. This is typically the largest sub-national administrative unit of a country. Note that some large cities (such as Tokyo and Istanbul) may be categorized as regions rather than places.
1 country Generally recognized countries or, in some cases like Hong Kong, an area of quasi-national administrative status that has been given a designated country code under ISO 3166-1.
0 Unknown location.

Inputs


locations (text)
A list of locations to be geocoded, one per line.
mapboxApiKey (text)

Outputs


data (datatable)
csv (file)
A CSV file containing the the original locations with latitude and longitude.