From 6276d186715d46dc3a77f3a5e48a292656d6657d Mon Sep 17 00:00:00 2001 From: nobohan Date: Sun, 25 Jun 2023 10:49:01 +0200 Subject: [PATCH] adapt carto mapnik xml compilation and osm2pgsql import for cyclosm --- run.sh | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/run.sh b/run.sh index 84820d9..458e9c1 100755 --- a/run.sh +++ b/run.sh @@ -29,22 +29,17 @@ fi set -x -# if there is no custom style mounted, then use osm-carto -if [ ! "$(ls -A /data/style/)" ]; then - mv /home/renderer/src/openstreetmap-carto-backup/* /data/style/ -fi - -# carto build -if [ ! -f /data/style/mapnik.xml ]; then - cd /data/style/ - carto ${NAME_MML:-project.mml} > mapnik.xml -fi - if [ "$1" == "terminal" ]; then bash fi if [ "$1" == "import" ]; then + + cd /data/style/ + git clone --single-branch --branch v0.6 https://github.com/cyclosm/cyclosm-cartocss-style.git --depth 1 + # carto build + carto cyclosm-cartocss-style/project.mml > mapnik.xml + # Ensure that database directory is in right state mkdir -p /data/database/postgres/ chown renderer: /data/database/ @@ -101,9 +96,6 @@ if [ "$1" == "import" ]; then # Import data sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore \ - --tag-transform-script /data/style/${NAME_LUA:-openstreetmap-carto.lua} \ - --number-processes ${THREADS:-4} \ - -S /data/style/${NAME_STYLE:-openstreetmap-carto.style} \ /data/region.osm.pbf \ ${OSM2PGSQL_EXTRA_ARGS:-} \ ; @@ -119,11 +111,11 @@ 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 + #Import external data TODO cyclosm: change this + # 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 @@ -206,7 +198,7 @@ if [ "$1" == "generate_tiles" ]; then sudo -u renderer renderd -c /etc/renderd.conf - cat /data/tiles/default/tiles.list | render_list --map default + cat /data/tiles/cyclosm/tiles.list | render_list --map cyclosm fi echo "invalid command"