Learn R Programming

tidygeocoder (version 1.0.1)

query_api: Execute a geocoder API query

Description

The get_api_query function can create queries for this function to execute.

Usage

query_api(
  api_url,
  query_parameters,
  mode = "single",
  batch_file = NULL,
  address_list = NULL,
  content_encoding = "UTF-8",
  timeout = 20
)

Arguments

api_url

Base URL of the API. query parameters are appended to this

query_parameters

api query parameters in the form of a named list

mode
  • "single" : geocode a single address (all methods)

  • "list" : batch geocode a list of addresses (geocodio)

  • "file" : batch geocode a file of addresses (census)

batch_file

a csv file of addresses to upload (census)

address_list

a list of addresses for batch geocoding (geocodio) should be 'json' for geocodio and 'multipart' for census

content_encoding

Encoding to be used for parsing content

timeout

timeout in minutes

Value

raw results from the query

See Also

get_api_query extract_results geo

Examples

Run this code
# NOT RUN {
raw <- query_api("http://nominatim.openstreetmap.org/search", 
   get_api_query("osm", list(address = 'Hanoi, Vietnam')))
   
extract_results('osm', jsonlite::fromJSON(raw))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab