arc_reverse_geo {arcgeocoder} | R Documentation |
Reverse Geocoding using the ArcGIS REST API
Description
Generates an address from a latitude and longitude. Latitudes must be
in the range \left[-90, 90 \right]
and longitudes in the range
\left[-180, 180 \right]
. This function returns the
tibble
associated with the query.
Usage
arc_reverse_geo(
x,
y,
address = "address",
full_results = FALSE,
return_coords = TRUE,
verbose = FALSE,
progressbar = TRUE,
outsr = NULL,
langcode = NULL,
featuretypes = NULL,
locationtype = NULL,
custom_query = list()
)
Arguments
x |
longitude values in numeric format. Must be in the range
|
y |
latitude values in numeric format. Must be in the range
|
address |
address column name in the output data (default |
full_results |
returns all available data from the API service. If
|
return_coords |
return input coordinates with results if |
verbose |
if |
progressbar |
Logical. If |
outsr |
The spatial reference of the |
langcode |
Sets the language in which reverse-geocoded addresses are returned. |
featuretypes |
This parameter limits the possible match types returned.
By default is |
locationtype |
Specifies whether the output geometry of
|
custom_query |
API-specific parameters to be used, passed as a named list. |
Details
More info and valid values in the ArcGIS REST docs.
Value
A tibble
with the corresponding results. The x,y
values
returned by the API would be named lon,lat
. Note that these coordinates
correspond to the geocoded feature, and may be different of the x,y
values
provided as inputs.
See the details of the output in ArcGIS REST API Service output.
outsr
The 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.
featuretypes
See vignette("featuretypes", package = "arcgeocoder")
for a detailed
explanation of this parameter.
This parameter may be used for filtering the type of feature to be returned when geocoding. Possible values are:
-
"StreetInt"
-
"DistanceMarker"
-
"StreetAddress"
-
"StreetName"
-
"POI"
-
"Subaddress"
-
"PointAddress"
-
"Postal"
-
"Locality"
It is also possible to use several values as a vector
(featuretypes = c("PointAddress", "StreetAddress")
).
References
See Also
Other functions for geocoding:
arc_geo()
,
arc_geo_categories()
,
arc_geo_multi()
Examples
arc_reverse_geo(x = -73.98586, y = 40.75728)
# Several coordinates
arc_reverse_geo(x = c(-73.98586, -3.188375), y = c(40.75728, 55.95335))
# With options: using some additional parameters
sev <- arc_reverse_geo(
x = c(-73.98586, -3.188375),
y = c(40.75728, 55.95335),
# Restrict to these feautures
featuretypes = "POI,StreetInt",
# Result on this WKID
outsr = 102100,
verbose = TRUE, full_results = TRUE
)
dplyr::glimpse(sev)