reverse-geocoding

Convert latitude & longitude in datatable columns to location names.

Converts latitude & longitude in datatable columns to location names.

Note: latitude & longitude must be in +/- values, not E/W/N/S. See conversion tips here

Arguments

Inputs:

data: The datatable containing the latitude & longitude columns to be converted.

PlaceType: The type of the geographic feature. Valid options are address, city, continent, country, country code, country name, county, ISO-3166-1-alpha-2, ISO-3166-1-alpha-3, ISO-3166-2, postcode, state code, or state name. Defaults to country.

latitudeColumn: The name of the column containing latitude values (in decimal degrees) A number preceded by a sign character. A plus sign (+) denotes northern hemisphere, and a minus sign (-) denotes southern hemisphere. If unspecified, defaults to "latitude".

longitudeColumn: The name of the column containing longitude values (in decimal degrees). A plus sign (+) denotes east longitude, and a minus sign (-) denotes west longitude. If unspecified, defaults to "longitude".

resultColumn: The name of the column to hold location (place) information. It may make sense to name the new column with the PlaceType.

Output:

data: A datatable containing the new geocoding column resultColumn (place/location).

Possible use cases

  • Create a text label for geographic mapping in Microreact.

  • Use with forward-geocoding to get standardized place names (i.e. forward geocoding can interpret "uk" and "UK" and "United Kingdom" and give the same lat/long for all of those, and then reverse-geocoding can provide identical "country" values based on those lat/long values)

Last updated