With this, you can build your own local IGN TOPO Database. Currently, it provides ONLY building information.
The API provides also a viewer to explore it.
This api is eligible to a merge with parcellaire express to build only one product, probably in the future.
Inspired from PARCELLAIRE EXPRESS
-
Copy .env.example to .env. Change to values that suit your needs.
-
Generate
docker-compose.ymlfiledocker-compose -f docker-compose.common.yml -f docker-compose.dev.yml config > docker-compose.yml -
Tune you postgres with pgtunes and update
docker-composer.ymlwith the new values -
Build images
docker-compose build -
Eventually push the images to a registry for the stack environment.
docker login <registry> docker-compose push
-
Turn on the services
docker-compose upORdocker-compose up -dto start in the background. -
Import the dataset
- Download
docker-compose run -ti topo-importer python3 /tmp/download-dataset.py - Import
docker-compose run -ti topo-importer bash /tmp/import-data.sh
- Download
-
Use the api
- Use the viewer with the url defined by VIEWER_URL
- Use the routes defined below
-
Turn off the services
docker-compose downORdocker-compose down -vto destroy the dataset (only if the data are in volumes)
-
Copy
.env.exampleto.env. Change to values that suit the production environment. -
Ensure
docker-composeis installed : Installation guide -
Generate
docker-stack.ymlfiledocker-compose -f docker-compose.common.yml -f docker-compose.stack.yml config > docker-stack.yml -
Tune you postgres with pgtunes and update
docker-stack.ymlwith the new values -
Turn on the services
# Deploy docker stack deploy topo -c docker-stack.yml --with-registry-auth # Check docker stack ps --no-trunc # Service reference docker service ls
-
Import the dataset
-
Download
docker exec -ti topo_topo-importer.XXXXX python3 /tmp/download-dataset.py -
Import
docker exec -ti topo_topo-importer.XXXXX /bin/bash /tmp/import-data.sh
-
-
Use the api
- Use the viewer with the url defined by VIEWER_URL
- Use the routes defined below
-
Turn off the services
docker stack rm topo
- GET
/building/{id}: Retrieve a building definition by its id. - GET
/building?pos={pos}ou/building?lon={lon}&lat={lat}: Find the buildings that intersect with a geographic coordinate (WGS84) - GET
/building?bbox={bbox}ou/building?lon_min={lon}&lat_min={lat}&lon_max={lon}&lat_max={lat}: Find the buildings that intersect with a bounding box expressed in geographic coordinates (WGS84)
⭐️ When the api is protected by an API Key, please provide an Authorization Header like this:
`Authorization: Bearer <api_key>`
OR
`Authorization: Token <api_key>`
{id}: Unique building identifier (ex:BATIMENTXXXXX){lon}: Longitude (real number from -180 to 180){lat}: Latitude (real number from -90 to 90){pos}: Position composed from 2 coordinates (lon,lat){bbox}: Bounding box composed from 4 coordonnates (lon_min,lat_min,lon_max,lat_max)
Results are provided in GeoJSON format.
TODO: add a remote container for vscode.
- Thanks to Geosophy for its support.
- Thanks to Emmanuel S. (IGNFab) for his guidance.