Configuration
First user
Log in to the application with the previously configured authentication service.
To make this first user an administrator (after they log in), run the following SQL command:
INSERT INTO lebontag.lbt_user_userrole (u_id, ur_id) VALUES(1, 1);
OSM data
Reference OSM data
Reference OSM data must contain certain metadata (contributor, date, changeset, etc.).
Go to https://download.openstreetmap.fr/extracts/europe/ and download the file containing your work area, for example:
- https://download.openstreetmap.fr/extracts/europe/france.osm.pbf [or]
- https://download.openstreetmap.fr/extracts/europe/france/languedoc_roussillon.osm.pbf [or]
- https://download.openstreetmap.fr/extracts/europe/france/languedoc_roussillon/herault.osm.pbf
Place the downloaded file on the server, in ‘/opt/lebontag-v2/osm/source/’.
Rename it ‘data.osm.pbf’ (or modify the ‘osm_pbffile’ parameter in the database or from the administration interface).
Warning: never delete this file, as it will be used by the application to load data.
Also download the associated ‘state.txt’ file, for example:
- https://download.openstreetmap.fr/extracts/europe/france.state.txt [or]
- https://download.openstreetmap.fr/extracts/europe/france/languedoc_roussillon.state.txt [or]
- https://download.openstreetmap.fr/extracts/europe/france/languedoc_roussillon/herault.state.txt
Note the number of the ‘sequenceNumber’ contained in this file, for example: 6844104.
Write this number in the new file /opt/lebontag-v2/osm/replication/sequence.txt, for example:
$ echo 6844104 > /opt/lebontag-v2/osm/replication/sequence.txt
Replace 0000000 with this number in the lebontag.lbt_repl_state table, for example:
UPDATE lebontag.lbt_repl_state SET last_done_seq=6844104 WHERE id=1;
Specify the URL for data replication (diff files per minute) from ‘https://download.openstreetmap.fr/replication’.
For example, ‘https://download.openstreetmap.fr/replication/europe/france/languedoc_roussillon/herault/minute/’.
In SQL:
INSERT INTO lebontag.lbt_setting (s_name, s_value) VALUES ('osm_repl_server','https://download.openstreetmap.fr/replication/europe/france/languedoc_roussillon/herault/minute/') ON CONFLICT (s_name) DO UPDATE SET s_value = EXCLUDED.s_value;
Finally, trigger the loading of reference data into the database using an osm2pgsql script:
$ sudo -E /opt/lebontag-v2/scripts/lbt-load-data.sh
The load log file will be created in ‘/opt/lebontag-v2/log/lbt-load-data/’. Check its contents.
CRON
The following two CRON tasks clean up the logs and downloaded files and update the osm2pgsql database with the objects validated in LeBonTag.
echo 'MAILTO=""
0 0 * * * root /opt/lebontag-v2/cron/lbt-cleaning.sh
0 1 * * * root /opt/lebontag-v2/cron/lbt-update-db-by-osc.sh' > /etc/cron.d/lebontag-v2
Replication service
This service downloads and aggregates OSM updates every hour (it replaces the old Overpass API call).
Before activating this service, at least one right-of-way must have been created in the application.
$ cp /opt/lebontag-v2/services/* /etc/systemd/system/
$ systemctl daemon-reload
$ systemctl enable --now lbt-pipeline.timer
To run the service immediately:
$ systemctl start lbt-pipeline.service
Configuration from the interface
- Associate users with rights of footprints, business groups, roles, etc.
- Activate object groups or create new ones.
- Set validation rights.
Logging
- /log/lbt-autovalidation: self-validated OSM objects
- /log/lbt-fetch: retrieval of modified OSM objects
- /log/lbt-footprints-intersection: intersection between modified objects and footprints
- /log/lbt-load-data: loading of reference data
- /log/lbt-update-db-by-osc: database update by validated objects