knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(njgeo) library(sf)
Tools for geocoding addresses using the State of New Jersey's official geocoding service & accessing spatial data.
You can install njgeo from CRAN using
install.packages("njgeo")
You can install the development version of njgeo from GitHub with:
# install.packages("devtools") devtools::install_github("gavinrozzi/njgeo")
This package supports freely geocoding addresses in New Jersey. No API keys are required and this does not depend on any commercial services.
geocode_address_candidates("33 Livingston Ave. New Brunswick, NJ")
The geocoding output defaults to EPSG:4326 but another CRS can be specified via arguments:
geocode_address_candidates("33 Livingston Ave. New Brunswick, NJ", crs = 3424)
It is possible to batch geocode up to 1000 addresses at once using the two batch geocoding functions provided by the package.
The batch_geocode_addresses()
and batch_geocode_sl()
functions can batch geocode up to 1000 addresses at a time. The first function expects multiple columns of data to geocode the address, while the sl version requires an address in single column format.
Provide a point to get matching addresses:
point <- st_point(c(-74.44513, 40.49297)) reverse_geocode(point)
You can easily obtain spatial boundary data for use in projects via this package. All objects are returned as an {sf}
object and a coordinate reference system can be specified via arguments to repoject the shape into a different CRS.
get_state_bounds()
get_county_bounds()
get_muni_bounds()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.