geo_lite function

Address search API (free-form query)

Address search API (free-form query)

Geocodes addresses given as character values. This function returns the tibble associated with the query, see geo_lite_sf() for retrieving the data as a spatial object (sf format).

This function correspond to the free-form query search described in the API endpoint.

geo_lite( address, lat = "lat", long = "lon", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = "https://nominatim.openstreetmap.org/", progressbar = TRUE, custom_query = list() )

Arguments

  • address: character with single line address, e.g. ("1600 Pennsylvania Ave NW, Washington") or a vector of addresses (c("Madrid", "Barcelona")).
  • lat: Latitude column name in the output data (default "lat").
  • long: Longitude column name in the output data (default "long").
  • limit: Maximum number of results to return per input address. Note that each query returns a maximum of 50 results.
  • 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_addresses: Return input addresses 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: A named list with API-specific parameters to be used (i.e. list(countrycodes = "US")). See Details .

Returns

A tibble with the results found by the query.

Details

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

Examples

geo_lite("Madrid, Spain") # Several addresses geo_lite(c("Madrid", "Barcelona")) # With options: restrict search to USA geo_lite(c("Madrid", "Barcelona"), custom_query = list(countrycodes = "US"), full_results = TRUE )

See Also

geo_lite_sf(), tidygeocoder::geo().

Geocoding: geo_address_lookup(), geo_address_lookup_sf(), geo_amenity(), geo_amenity_sf(), geo_lite_sf(), geo_lite_struct(), geo_lite_struct_sf()