| arc_geo | R Documentation |
Geocodes addresses given as character values. This function returns the tibble object associated with the query.
This function uses the SingleLine approach detailed in the
ArcGIS REST docs. For multi-field queries (i.e.
using specific address components), use arc_geo_multi().
arc_geo(
address,
lat = "lat",
long = "lon",
limit = 1,
full_results = FALSE,
return_addresses = TRUE,
verbose = FALSE,
progressbar = TRUE,
outsr = NULL,
langcode = NULL,
sourcecountry = NULL,
category = NULL,
custom_query = list()
)
address |
Single-line address text (e.g.
|
lat |
Latitude column name in the output data (default |
long |
Longitude column name in the output data (default |
limit |
Maximum number of results to return per input address. Each query has a hard API limit of 50 results. |
full_results |
Logical; if |
return_addresses |
Logical; if |
verbose |
Logical; if |
progressbar |
Logical; if |
outsr |
The spatial reference of the |
langcode |
Sets the language in which reverse-geocoded addresses are returned. |
sourcecountry |
Country filter using ISO codes (e.g. |
category |
Place or address type used as a filter. Multiple values are
accepted (e.g. |
custom_query |
Additional API parameters as named list values. |
See the ArcGIS REST docs for more info and valid values.
A tibble object with the results. See the details of the output in ArcGIS REST API Service output.
outsrThe spatial reference can be specified as either a well-known ID (WKID). If not specified, the spatial reference of the output locations is the same as that of the service (WGS84, i.e. WKID = 4326)).
See arc_spatial_references for values and examples.
ArcGIS REST findAddressCandidates.
tidygeocoder::geo()
Other functions for geocoding:
arc_geo_categories(),
arc_geo_multi(),
arc_reverse_geo()
arc_geo("Madrid, Spain")
library(dplyr)
# Several addresses with additional output fields
with_params <- arc_geo(c("Madrid", "Barcelona"),
custom_query = list(outFields = c("LongLabel", "CntryName"))
)
with_params |>
select(lat, lon, CntryName, LongLabel)
# With options: restrict search to USA
with_params_usa <- arc_geo(c("Madrid", "Barcelona"),
sourcecountry = "USA",
custom_query = list(outFields = c("LongLabel", "CntryName"))
)
with_params_usa |>
select(lat, lon, CntryName, LongLabel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.