Description Usage Arguments Value See Also Examples
View source: R/query_factory.R
The get_api_query function can create queries for this function to execute.
1 2 3 4 5 6 7 8 9 10 |
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 |
determines the type of query to execute - "single": geocode a single input (all methods) - "list": batch geocode a list of inputs (ex. geocodio) - "file": batch geocode a file of inputs (ex. census) |
batch_file |
a csv file of input data to upload (for |
input_list |
a list of input data (for |
content_encoding |
Encoding to be used for parsing content |
timeout |
timeout in minutes |
method |
if 'mapquest' or 'arcgis' then the query status code is changed appropriately |
a named list containing the response content (content
) and the HTTP request status (status
)
get_api_query extract_results extract_reverse_results geo reverse_geo
1 2 3 4 5 6 7 8 9 10 11 | raw1 <- query_api("http://nominatim.openstreetmap.org/search",
get_api_query("osm", list(address = 'Hanoi, Vietnam')))
raw1$status
extract_results('osm', jsonlite::fromJSON(raw1$content))
raw2 <- query_api("http://nominatim.openstreetmap.org/reverse",
get_api_query("osm", custom_parameters = list(lat = 38.895865, lon = -77.0307713)))
extract_reverse_results('osm', jsonlite::fromJSON(raw2$content))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.