reverse_geo_lite: Reverse geocoding API

View source: R/reverse_geo_lite.R

reverse_geo_liteR Documentation

Reverse geocoding API

Description

Generates an address from a latitude and longitude. Latitudes must be between \left[-90, 90 \right] and longitudes between \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).

Usage

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 \left[-90, 90 \right].

long

Longitude values in numeric format. Must be in the range \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.

Details

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

Value

A tibble with the results found by the query.

About Zooming

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

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

See Also

reverse_geo_lite_sf(), tidygeocoder::reverse_geo().

Reverse geocoding coordinates: reverse_geo_lite_sf()

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)



nominatimlite documentation built on Sept. 11, 2024, 7:47 p.m.