geocode_addresses: Convert City of Dallas addresses to lat/long coordinates

Description Usage Arguments Value Examples

View source: R/geocoders.R

Description

Find lat/long coordinates for a given set of addresses using the City of Dallas's public geocodeAddresses service. See ArcGIS's documentation page for additional details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
geocode_addresses(
  street,
  city = NULL,
  zip = NULL,
  id = seq_along(street),
  server = c("DallasStreetsLocator", "ParcelLocator", "AccountPointsLocator",
    "AccountpointsStreetLocator"),
  out_sr = 4326,
  output = c("latlong", "all")
)

Arguments

street

character vector of street addresses to geocode.

city

optional, character vector of city names to geocode.

zip

optional, vector of postal codes to geocode.

id

optional, numeric vector uniquely identifying each address. providing this argument note that each integer must be unique.

server

GeocodeServer to use. Defaults to DallasStreetsLocator. Refer to the ToolServices API directory for details on each server.

out_sr

Spatial Reference ID (WKID) for the desired lat/long coordinate system. Defaults to 4326 (WGS84). If using with one of the City of Dallas's MapServers, you may wish to set this to 2276, the default WKID for many Dallas services. Refer to ArcGIS's Projected and Geographic coordinate system documentation pages for a full list of valid WKIDs.

output

output of this function. If latlong (default), will return a dataframe of lat/long coordinates and addresses. If all, will return the full JSON response from the server as a list.

Value

A dataframe or list of geocoded address results.

Examples

1
2
3
4
5
6
7
8
addresses <- data.frame(
  street = c('8525 Garland Rd', '1500 Marilla St', '3809 Grand Avenue'),
  city = c('Dallas', 'Dallas', 'Dallas'),
  zip = c(75218, 75201, 75210)
)
geocode_addresses(addresses$street, addresses$city, addresses$zip)

geocode_addresses(addresses$street)

log-linear/DallasGeocodeR documentation built on Dec. 21, 2021, 11:45 a.m.