Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/rgeocodio
Tools to Work with the https://geocod.io/ API
https://github.com/hrbrmstr/rgeocodio
geocoding geocodio r r-cyber reverse-geocode reverse-geocoding rstats
Last synced: 6 days ago
JSON representation
Tools to Work with the https://geocod.io/ API
- Host: GitHub
- URL: https://github.com/hrbrmstr/rgeocodio
- Owner: hrbrmstr
- Created: 2017-03-05T19:41:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T18:40:11.000Z (over 4 years ago)
- Last Synced: 2024-10-12T21:24:02.256Z (22 days ago)
- Topics: geocoding, geocodio, r, r-cyber, reverse-geocode, reverse-geocoding, rstats
- Language: R
- Homepage:
- Size: 34.2 KB
- Stars: 56
- Watchers: 8
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - hrbrmstr/rgeocodio - Tools to Work with the https://geocod.io/ API (R)
README
---
output: rmarkdown::github_document
---`rgeocodio` : Tools to Work with the 'API'
NOTE: You need an [API key](https://dash.geocod.io/) 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:
- `gio_auth`: Get or set GEOCODIO_API_KEY value
- `gio_batch_geocode`: Geocode up to 10,000 addresses
- `gio_batch_reverse`: Reverse geocode up to 10,000 coordinates
- `gio_geocode`: Geocode a single address
- `gio_geocode_components`: Geocode a single address
- `gio_reverse`: Reverse geocode a single lat/lon pairAll functions return tidy `tibble`s with sane column names.
### TODO
- enable selection of additional fields
- better return types
- a tad more error checking (especially processing API [status codes](https://geocod.io/docs/#errors)
- more/better tests along with full code coverage
- Add R examples to the [official documentation](https://github.com/geocodio/docs)### Installation
```{r eval=FALSE}
devtools::install_github("hrbrmstr/rgeocodio")
``````{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```### Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
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_codegio_batch_reverse(to_code)
```### Extra Fields
```{r message=FALSE, warning=FALSE, error=FALSE}
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
```{r message=FALSE, warning=FALSE, error=FALSE}
library(rgeocodio)
library(testthat)date()
test_dir("tests/")
```