geo_lite_struct function

Address search API (structured query)

Address search API (structured query)

Geocodes addresses already split into components. This function returns the tibble associated with the query, see geo_lite_struct_sf() for retrieving the data as a spatial object (sf format).

This function correspond to the structured query search described in the API endpoint. For performing a free-form search use geo_lite().

geo_lite_struct( amenity = NULL, street = NULL, city = NULL, county = NULL, state = NULL, country = NULL, postalcode = NULL, lat = "lat", long = "lon", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = "https://nominatim.openstreetmap.org/", custom_query = list() )

Arguments

  • amenity: Name and/or type of POI, see also geo_amenity .
  • street: House number and street name.
  • city: City.
  • county: County.
  • state: State.
  • country: Country.
  • postalcode: Postal Code.
  • 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/".
  • 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

The structured form of the search query allows to look up up an address that is already split into its components. Each parameter represents a field of the address. All parameters are optional. You should only use the ones that are relevant for the address you want to geocode.

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

Examples

pl_mayor <- geo_lite_struct( street = "Plaza Mayor", country = "Spain", limit = 50, full_results = TRUE ) dplyr::glimpse(pl_mayor)

See Also

geo_lite_struct_sf(), tidygeocoder::geo().

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