rgeocodio : Tools to Work with the https://geocod.io/ 'API'

NOTE: You need an API key to use this package.

There is a great deal of API documentation in the main pacakge help page. It is highly suggested you do help("rgeocodio-package") after installing the package.

The following functions are implemented:

All functions return tidy tibbles with sane column names.

TODO

Installation

devtools::install_github("hrbrmstr/rgeocodio")
options(width=120)

Usage

library(rgeocodio)

# current verison
packageVersion("rgeocodio")

gio_geocode("1109 N Highland St, Arlington, VA")

gio_geocode_components("1109 N Highland St", "Arlington", "VA")

gio_reverse(38.9002898, -76.9990361)

addresses <- c(
  "1109 N Highland St, Arlington VA",
  "525 University Ave, Toronto, ON, Canada",
  "4410 S Highway 17 92, Casselberry FL",
  "15000 NE 24th Street, Redmond WA",
  "17015 Walnut Grove Drive, Morgan Hill CA"
)

gio_batch_geocode(addresses)

data.frame(
  lat = c(35.9746000, 32.8793700, 33.8337100, 35.4171240),
  lon = c(-77.9658000, -96.6303900, -117.8362320, -80.6784760)
) -> to_code

gio_batch_reverse(to_code)

Extra Fields

gio_geocode("1109 N Highland St, Arlington, VA", fields=c("cd", "stateleg"))

gio_geocode_components("1109 N Highland St", "Arlington", "VA",
                      fields=c("census", "stateleg"))

gio_reverse(38.9002898, -76.9990361, fields=c("census", "stateleg"))

gio_batch_geocode(addresses, fields=c("cd", "stateleg"))

gio_batch_reverse(to_code, fields=c("census", "stateleg"))

Test Results

library(rgeocodio)
library(testthat)

date()

test_dir("tests/")


hrbrmstr/rgeocodio documentation built on May 17, 2020, 3:37 a.m.