Geocode an address and retrieve all candidates using the NJOGIS ArcGIS REST API

geocode_address_candidates(
  address = NULL,
  address2 = NULL,
  address3 = NULL,
  city = NULL,
  zip = NULL,
  max_results = NULL,
  crs = 4326
)

Arguments

address

First line of address. Don't use the other address arguments if geocoding a single line address

address2

Second line of address

address3

Third line of address

city

Name of city or municipality

zip

5-digit ZIP code of city

max_results

Max number of address candidates to return

crs

Four digit coordinate reference system code. Defaults to 4326, 3424 and 4269 are also supported

Value

an sf object with geocoded address candidates for a single address

Examples

geocode_address_candidates(address = "33 Livingston Ave", city = "New Brunswick")
#> njgeo: downloading data
#> Simple feature collection with 1 feature and 8 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -74.44513 ymin: 40.49297 xmax: -74.44513 ymax: 40.49297
#> Geodetic CRS:  WGS 84
#>                                          address score location.x location.y
#> 1 33 Livingston Avenue, New Brunswick, NJ, 08901   100  -74.44513   40.49297
#>   extent.xmin extent.ymin extent.xmax extent.ymax                   geometry
#> 1   -74.44613    40.49197   -74.44413    40.49397 POINT (-74.44513 40.49297)