arc_reverse_geo: Reverse Geocoding using the ArcGIS REST API

View source: R/arc_reverse_geo.R

arc_reverse_geoR 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 \left[-180, 180 \right].

y

latitude values in numeric format. Must be in the range \left[-90, 90 \right].

address

Output address column name (default "address").

full_results

Logical; if TRUE return all available API fields. FALSE (default) returns latitude, longitude and address only.

return_coords

Logical; if TRUE return input coordinates with results.

verbose

Logical; if TRUE output process messages to console.

progressbar

Logical; if TRUE shows a progress bar for multiple points.

outsr

The spatial reference of the ⁠x,y⁠ coordinates returned by a geocode request. By default is NULL (i.e. the argument won't be used in the query). See Details and arc_spatial_references.

langcode

Sets the language in which reverse-geocoded addresses are returned.

featuretypes

This argument limits the possible match types returned. By default is NULL (i.e. the argument won't be used in the query). See Details.

locationtype

Specifies whether the output geometry of featuretypes = "PointAddress" or featuretypes = "Subaddress" matches should be the rooftop point or street entrance location. Valid values are NULL (i.e. not using the argument in the query), rooftop and street.

custom_query

API-specific arguments to be used, passed as a named list.

Details

See the ArcGIS REST docs for more info and valid values.

Value

A tibble with the corresponding results. The ⁠x,y⁠ values returned by the API are named ⁠lon,lat⁠. Note that these coordinates correspond to the geocoded feature, and may be different from 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 argument.

This argument 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

ArcGIS REST reverseGeocode.

See Also

tidygeocoder::reverse_geo()

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 arguments
sev <- arc_reverse_geo(
  x = c(-73.98586, -3.188375),
  y = c(40.75728, 55.95335),
  # Restrict to these features
  featuretypes = "POI,StreetInt",
  # Result on this WKID
  outsr = 102100,
  verbose = TRUE, full_results = TRUE
)

dplyr::glimpse(sev)



arcgeocoder documentation built on March 20, 2026, 5:10 p.m.