Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joelgombin/banr

R client for the BAN API
https://github.com/joelgombin/banr

adresses ban ban-api bano geocode r

Last synced: 24 days ago
JSON representation

R client for the BAN API

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# An R client for the BAN API

[![R build status](https://github.com/joelgombin/banR/workflows/R-CMD-check/badge.svg)](https://github.com/joelgombin/banR/actions)


The `banR` package is a light R client for the [BAN API](https://geo.api.gouv.fr/adresse). The [Base Adresse Nationale (BAN)](https://adresse.data.gouv.fr/) is an open database of French adresses, produced by OpenStreetMap, La Poste, the IGN and Etalab.

`banR` can be installed from Github (current version):

```{r eval=FALSE}
# install.packages("devtools")
devtools::install_github("joelgombin/banR", build_vignettes = TRUE)
```

The CRAN version is out of date :

```{r eval=FALSE}
install.packages("banR")
```

`banR` allows to geocode lots of adresses in batch (the only hard limit is that, at the moment, the API only allows CSV files up to 50 MB). Please be gentle with the server though!

`banR` is designed to be used in a data exploration workflow, with a syntax 'à la [`tidyverse`](http://tidyverse.org)':

```{r}
library(dplyr)
library(banR)
data("paris2012")

paris2012 %>%
slice(1:100) %>%
mutate(adresse = paste(numero, voie, nom),
code_insee = paste0("751", arrondissement)) %>%
geocode_tbl(adresse = adresse, code_insee = code_insee) %>%
glimpse()
```

To know more about this package, please read the [vignette](http://joelgombin.github.io/banR/articles/geocode.html) (`vignette("geocode")`)

Please report issues and suggestions to the [issues tracker](https://github.com/joelgombin/banR/issues).

## See also

* [BAN-geocoder](https://github.com/atao/BAN-Geocoder), python wrapper for adresse.data.gouv.fr
* [tidygeocoder](https://github.com/jessecambon/tidygeocoder), r package similar to banR using other geocoding services such as US Census geocoder, Nominatim (OSM), Geocodio, and Location IQ.