Learn R Programming

nominatimlite (version 0.1.6)

reverse_geo_lite: Reverse geocode coordinates

Description

Reverse geocodes geographic coordinates (latitude and longitude) given as numeric values. Latitudes must be between -90 and 90 and longitudes must be between -180 and 180.

Usage

reverse_geo_lite(
  lat,
  long,
  address = "address",
  full_results = FALSE,
  return_coords = TRUE,
  verbose = FALSE,
  custom_query = list()
)

Arguments

lat

latitude values (input data)

long

longitude values (input data)

address

name of the address column (in the output data)

full_results

returns all available data from the geocoding service if TRUE. If FALSE (default) then only a single address column is returned from the geocoding service.

return_coords

return input coordinates with results if TRUE. Note that most services return the input coordinates with full_results = TRUE and setting return_coords to FALSE does not prevent this.

verbose

if TRUE then detailed logs are output to the console. FALSE is default. Can be set permanently with options(tidygeocoder.verbose = TRUE)

custom_query

API-specific parameters to be used, passed as a named list (ie. list(zoom = 3)). See Details.

Value

A tibble with the results.

Details

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

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()

Other geocoding: geo_address_lookup(), geo_amenity(), geo_lite()

Examples

Run this code
# NOT RUN {
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
reverse_geo_lite(
  lat = c(40.75728, 55.95335),
  long = c(-73.98586, -3.188375),
  custom_query = list(zoom = 0),
  verbose = TRUE,
  full_results = TRUE
)
# }

Run the code above in your browser using DataLab