View source: R/core-reverse-geocode.R
reverse_geocode | R Documentation |
Determines the address for a given point.
reverse_geocode(
locations,
crs = sf::st_crs(locations),
...,
lang_code = NULL,
feature_type = NULL,
location_type = c("rooftop", "street"),
preferred_label_values = c("postalCity", "localCity"),
for_storage = FALSE,
geocoder = default_geocoder(),
token = arc_token(),
.progress = TRUE
)
locations |
an |
crs |
the CRS of the returned geometries. Passed to |
... |
unused. |
lang_code |
default |
feature_type |
limits the possible match types returned. Must be one of
|
location_type |
default |
preferred_label_values |
default NULL. Must be one of |
for_storage |
default |
geocoder |
default |
token |
an object of class |
.progress |
default |
This function utilizes the
/reverseGeocode
endpoint of a geocoding service. By default, it uses
the public ArcGIS World Geocoder.
Intersection matches are only returned when feature_types = "StreetInt"
. See REST documentation for more.
Specifies whether the output geometry shuold be the rooftop point or the street entrance location.
The location_type
parameter changes the geometry's placement but does not
change the attribute values of X
, Y
, or DisplayX
, and DisplayY
.
Very Important
The argument for_storage
is used to determine if the request allows you to
persist the results of the query. It is important to note that there are
contractual obligations to appropriately set this argument. You cannot save
or persist results when for_storage = FALSE
(the default).
The /reverseGeocode
endpoint can only handle one address at a time. To
make the operation as performant as possible, requests are sent in parallel
using httr2::req_perform_parallel()
. The JSON responses are then processed
using Rust and returned as an sf object.
An sf object.
# Find addresses from locations
reverse_geocode(c(-117.172, 34.052))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.