reverse_geo_lite function

Reverse geocoding API

Reverse geocoding API

Generates an address from a latitude and longitude. Latitudes must be between [90,90]\left[-90, 90 \right] and longitudes between [180,180]\left[-180, 180 \right]. This function returns the tibble associated with the query, see reverse_geo_lite_sf() for retrieving the data as a spatial object (sf format).

reverse_geo_lite( lat, long, address = "address", full_results = FALSE, return_coords = TRUE, verbose = FALSE, nominatim_server = "https://nominatim.openstreetmap.org/", progressbar = TRUE, custom_query = list() )

Arguments

  • lat: Latitude values in numeric format. Must be in the range [90,90]\left[-90, 90 \right].
  • long: Longitude values in numeric format. Must be in the range [180,180]\left[-180, 180 \right].
  • address: Address column name in the output data (default "address").
  • full_results: Returns all available data from the API service. If FALSE (default) only latitude, longitude and address columns are returned. See also return_addresses.
  • return_coords: Return input coordinates with results if TRUE.
  • verbose: If TRUE then detailed logs are output to the console.
  • nominatim_server: The URL of the Nominatim server to use. Defaults to "https://nominatim.openstreetmap.org/".
  • progressbar: Logical. If TRUE displays a progress bar to indicate the progress of the function.
  • custom_query: API-specific parameters to be used, passed as a named list (ie. list(zoom = 3)). See Details .

Returns

A tibble with the results found by the query.

Details

See https://nominatim.org/release-docs/develop/api/Reverse/ for additional parameters to be passed to custom_query.

About Zooming

Use the option custom_query = list(zoom = 3) to adjust the output. Some equivalences on terms of zoom:

zoomaddress_detail
3country
5state
8county
10city
14suburb
16major streets
17major and minor streets
18building

Examples

reverse_geo_lite(lat = 40.75728, long = -73.98586) # Several coordinates reverse_geo_lite(lat = c(40.75728, 55.95335), long = c(-73.98586, -3.188375)) # With options: zoom to country level sev <- reverse_geo_lite( lat = c(40.75728, 55.95335), long = c(-73.98586, -3.188375), custom_query = list(zoom = 0, extratags = TRUE), verbose = TRUE, full_results = TRUE ) dplyr::glimpse(sev)

See Also

reverse_geo_lite_sf(), tidygeocoder::reverse_geo().

Reverse geocoding coordinates: reverse_geo_lite_sf()