rgeoapi — A package to access the GéoAPI
rgeoapi connects R to the GéoAPI, in order to get information about french geography.
rgeoapi is now on CRAN # rgeoapi This package requests informations from the French GeoAPI inside R — https://api.gouv.fr/explorer/geoapi/ ## GeoAPI Developped by Etalab, with La Poste, l’INSEE and OpenStreetMap, the GeoAPI API is a JSON interface designed to make requests on the French geographic database.
rgeoapi was developped to facilitate your geographic projects by giving you access to these informations straight inside R. With rgeoapi, you can get any coordinate, size and population of a French city, to be used in your maps.
For an optimal compatibility, all the names (especially outputs) used in this package are the same as the ones used in the GeoAPI. Please note that this package works only with French cities.
Install this package directly in R :
devtools::install_github"ColinFay/rgeoapi")How rgeoapi works
The version 1.0.0 works with eleven functions. Which are :-
ComByCodeGet City by INSEE Code -
ComByCoordGet City by Coordinates -
ComByDepGet Cities by Department -
ComByNameGet City by Name -
ComByPostalGet City by Postal Code -
ComByRegGet Cities by Region -
DepByCodeGet Department by INSEE Code -
DepByNameGet Department by Name -
DepByRegGet Departments by Region -
RegByCodeGet Region by INSEE Code -
RegByNameGet Region by Name
How the functions are constructed
In the GeoAPI, you can request for “Commune”, “Département” or “Région”. All the functions are constructed using this terminology : AByB.- A being the output you need – Com for “Commune” (refering to French cities), Dep for Département (for Department) and Reg for Région.
- B being the request parameter – Code for INSEE Code, Coord for Coordinates (WGS-84), Dep for Department, Name for name, Postal for Postal Code and Reg for Region.
French Tutorial & contact
A French tutorial on my website. Questions and feedbacks welcome !