Description Usage Arguments Value See Also Examples
Reverse geocodes geographic coordinates (latitude and longitude) given as numeric values.
Latitude and longitude inputs are limited to possible values. Latitudes must be between -90 and 90 and
longitudes must be between -180 and 180. Invalid values will not be sent to the geocoding service.
The reverse_geocode function utilizes this function on coordinates contained in dataframes.
See example usage in vignette("tidygeocoder")
.
Refer to api_parameter_reference, min_time_reference, and batch_limit_reference for more details on geocoding service parameters and usage.
This function uses the get_api_query, query_api, and extract_reverse_results functions to create, execute, and parse geocoder API queries.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | reverse_geo(
lat,
long,
method = "osm",
address = "address",
limit = 1,
full_results = FALSE,
mode = "",
unique_only = FALSE,
return_coords = TRUE,
min_time = NULL,
progress_bar = show_progress_bar(),
quiet = getOption("tidygeocoder.quiet", FALSE),
api_url = NULL,
timeout = 20,
flatten = TRUE,
batch_limit = NULL,
verbose = getOption("tidygeocoder.verbose", FALSE),
no_query = FALSE,
custom_query = list(),
api_options = list(),
iq_region = "us",
geocodio_v = 1.6,
mapbox_permanent = FALSE,
here_request_id = NULL,
mapquest_open = FALSE
)
|
lat |
latitude values (input data) |
long |
longitude values (input data) |
method |
the geocoding service to be used. API keys are loaded from environmental variables. Run
|
address |
name of the address column (in the output data) |
limit |
maximum number of results to return per input coordinate. For many geocoding services
the maximum value of the limit parameter is 100. Pass |
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. |
mode |
set to 'batch' to force batch geocoding or 'single' to force single coordinate
geocoding (one coordinate per query). If not specified then batch geocoding will
be used if available (given method selected) when multiple coordinates are
provided; otherwise single address geocoding will be used. For the "here" and "bing" methods the
batch mode should be explicitly specified with |
unique_only |
only return results for unique inputs if TRUE |
return_coords |
return input coordinates with results if TRUE. Note that
most services return the input coordinates with |
min_time |
minimum amount of time for a query to take (in seconds). If NULL then min_time will be set to the default value specified in min_time_reference. |
progress_bar |
if TRUE then a progress bar will be displayed
for single input geocoding (1 input per query). By default the progress bar
will not be shown for code executed when knitting R Markdown files or code within
an RStudio notebook chunk. Can be set permanently with |
quiet |
if TRUE then console messages that are displayed by default
regarding queries will be suppressed. FALSE is default.
Can be set permanently with |
api_url |
custom API URL. If specified, the default API URL will be overridden. This parameter can be used to specify a local Nominatim server, for instance. |
timeout |
query timeout (in minutes) |
flatten |
if TRUE (default) then any nested dataframes in results are flattened if possible. Note that in some cases results are flattened regardless such as for Geocodio batch geocoding. |
batch_limit |
limit to the number of coordinates in a batch geocoding query. Defaults to the value in batch_limit_reference if not specified. |
verbose |
if TRUE then detailed logs are output to the console. FALSE is default. Can be set
permanently with |
no_query |
if TRUE then no queries are sent to the geocoding service and verbose is set to TRUE. Used for testing. |
custom_query |
API-specific parameters to be used, passed as a named list
(ex. |
api_options |
a named list of parameters specific to individual services.
(ex.
|
iq_region |
|
geocodio_v |
|
mapbox_permanent |
|
here_request_id |
|
mapquest_open |
tibble (dataframe)
reverse_geocode api_parameter_reference min_time_reference batch_limit_reference
1 2 3 4 5 6 7 8 9 10 | options(tidygeocoder.progress_bar = FALSE)
reverse_geo(lat = 38.895865, long = -77.0307713, method = 'osm')
reverse_geo(
lat = c(38.895865, 43.6534817, 300),
long = c(-77.0307713, -79.3839347, 600),
method = 'osm', full_results = TRUE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.