From 9d1b824e0f9d8aa4969bb87e5a6e35f026bd054e Mon Sep 17 00:00:00 2001 From: nobohan Date: Sun, 25 Feb 2024 18:27:31 +0100 Subject: [PATCH] add scripts for osmbe and run it --- run.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 5a1b24a..b6022a9 100755 --- a/run.sh +++ b/run.sh @@ -15,11 +15,12 @@ function setPostgresPassword() { function compileStyle() { cd /data/style/ git clone --single-branch --branch update-2024 https://github.com/nobohan/openstreetmap-carto-be --depth 1 - # TODO check if changes are needed as in cyclosm and oam mkdir /data/style/patterns/ mv /data/style/openstreetmap-carto-be/patterns/* /data/style/patterns/ mkdir /data/style/symbols/ mv /data/style/openstreetmap-carto-be/symbols/* /data/style/symbols/ + mkdir /data/style/scripts/ + mv /data/style/openstreetmap-carto-be/scripts/* /data/style/scripts/ carto openstreetmap-carto-be/project-fr.mml > mapnik.xml } @@ -103,7 +104,7 @@ if [ "$1" == "import" ]; then OSM2PGSQL_EXTRA_ARGS="${OSM2PGSQL_EXTRA_ARGS:-} --flat-nodes /data/database/flat_nodes.bin" fi - # Import data TODO check the path and other options + # Import data sudo -u renderer osm2pgsql -d gis --create --hstore -G -S openstreetmap-carto-be/openstreetmap-carto.style --tag-transform-script openstreetmap-carto-be/openstreetmap-carto.lua \ /data/region.osm.pbf \ ${OSM2PGSQL_EXTRA_ARGS:-} \ @@ -120,6 +121,12 @@ if [ "$1" == "import" ]; then sudo -u postgres psql -d gis -f /data/style/${NAME_SQL:-indexes.sql} fi + #Import external data + chown -R renderer: /home/renderer/src/ /data/style/ + if [ -f /data/style/scripts/get-external-data.py ] && [ -f /data/style/external-data.yml ]; then + sudo -E -u renderer python3 /data/style/scripts/get-external-data.py -c /data/style/external-data.yml -D /data/style/data + fi + # Register that data has changed for mod_tile caching purposes sudo -u renderer touch /data/database/planet-import-complete