| Title: | Client for the 'BAN' API |
|---|---|
| Description: | A client for the 'Base Adresses Nationale' ('BAN') API, which allows to (batch) geocode and reverse-geocode French addresses. For more information about the 'BAN' and its API, please see <https://adresse.data.gouv.fr/outils/api-doc/adresse>. |
| Authors: | Joel Gombin [cre, aut], Paul-Antoine Chevalier [aut] |
| Maintainer: | Joel Gombin <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.4.9000 |
| Built: | 2026-05-27 06:57:51 UTC |
| Source: | https://github.com/joelgombin/banr |
This function is modified copy of the utils:::format.object_size function which is not exported. The main difference is that it returns values.
format_object_size(x, units = "b", standard = "auto", digits = 1L, ...)format_object_size(x, units = "b", standard = "auto", digits = 1L, ...)
x |
a number |
units |
a unit |
standard |
a standard |
digits |
number of digits |
... |
anything else |
Geocode
geocode(query)geocode(query)
query |
a string of the adress you want to geocode |
a tibble
## Not run: geocode(query = "39 quai André Citroën, Paris") ## End(Not run)## Not run: geocode(query = "39 quai André Citroën, Paris") ## End(Not run)
Geocode tbl geocodes a whole data frame
geocode_tbl(tbl, adresse, code_insee = NULL, code_postal = NULL)geocode_tbl(tbl, adresse, code_insee = NULL, code_postal = NULL)
tbl |
a data frame or tibble |
adresse |
adress column |
code_insee |
official citycode column |
code_postal |
official postcode column |
an augmented data frame of class tbl with latitude, longitude, etc
## Not run: table_test <- tibble::tibble( x = c("39 quai Andre Citroen", "64 Allee de Bercy", "20 avenue de Segur"), y = c("75015", "75012", "75007"), z = rnorm(3) ) geocode_tbl(tbl = table_test, adresse = x) geocode_tbl(tbl = table_test, adresse = x, code_postal = y) ## End(Not run)## Not run: table_test <- tibble::tibble( x = c("39 quai Andre Citroen", "64 Allee de Bercy", "20 avenue de Segur"), y = c("75015", "75012", "75007"), z = rnorm(3) ) geocode_tbl(tbl = table_test, adresse = x) geocode_tbl(tbl = table_test, adresse = x, code_postal = y) ## End(Not run)
Get features
get_features(x)get_features(x)
x |
the content of a request |
a tibble
Get geometry
get_geometry(x)get_geometry(x)
x |
a feature |
a tibble
This dataset includes addresses found in the Parisian electoral register in 2012.
paris2012paris2012
a tbl_df with 72107 lines and 7 variables
code of the arrondissement (district)
code of the polling station, in the arrondissement
street number
type of street
name of the street
number of voters registered at this adress
polling station ID
data have been collected by Baptiste Coulmont
Reverse geocode
reverse_geocode(long, lat)reverse_geocode(long, lat)
long |
longitude |
lat |
latitude |
a tibble
## Not run: reverse_geocode(long = 2.37, lat = 48.357) ## End(Not run)## Not run: reverse_geocode(long = 2.37, lat = 48.357) ## End(Not run)
reverse geocode a data frame
reverse_geocode_tbl(tbl, longitude, latitude)reverse_geocode_tbl(tbl, longitude, latitude)
tbl |
name of the tibble |
longitude |
name of the longitude column |
latitude |
name of the latitude column |
an augmented tibble with addresses
## Not run: table_reverse <- tibble::tibble( x = c(2.279092, 2.375933,2.308332), y = c(48.84683, 48.84255, 48.85032), z = rnorm(3) ) reverse_geocode_tbl(tbl = table_reverse, longitude = x, latitude = y) ## End(Not run)## Not run: table_reverse <- tibble::tibble( x = c(2.279092, 2.375933,2.308332), y = c(48.84683, 48.84255, 48.85032), z = rnorm(3) ) reverse_geocode_tbl(tbl = table_reverse, longitude = x, latitude = y) ## End(Not run)