switch back to defined filenames for style

This commit is contained in:
Greg 2022-02-16 15:52:02 -05:00
parent f4b6eb0850
commit 07d38f6135
3 changed files with 12 additions and 4 deletions

View File

@ -62,6 +62,10 @@ By default the container will fetch openstreetmap-carto if it is not specified.
docker run \
-e DOWNLOAD_PBF=https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf \
-e DOWNLOAD_POLY=https://download.geofabrik.de/europe/luxembourg.poly \
-e NAME_LUA=sample.lua
-e NAME_STYLE=test.style
-e NAME_MML=project.mml
-e NAME_SQL=test.sql
-v /home/user/openstreetmap-caro-modified:/home/renderer/src/openstreetmap-carto \
-v openstreetmap-data:/var/lib/postgresql/12/main \
overv/openstreetmap-tile-server \

View File

@ -20,7 +20,7 @@ OSM2PGSQL_BIN=osm2pgsql
TRIM_BIN=/home/$ACCOUNT/src/regional/trim_osc.py
DBNAME=gis
OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/*.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/*.style ${OSM2PGSQL_EXTRA_ARGS}"
OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/${NAME_LUA:-openstreetmap-carto.lua} --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/${NAME_STYLE:-openstreetmap-carto.style} ${OSM2PGSQL_EXTRA_ARGS}"
#------------------------------------------------------------------------------
# When using trim_osc.py we can define either a bounding box (such as this

10
run.sh
View File

@ -22,6 +22,10 @@ if [ "$#" -ne 1 ]; then
echo "environment variables:"
echo " THREADS: defines number of threads used for importing / tile rendering"
echo " UPDATES: consecutive updates (enabled/disabled)"
echo " NAME_LUA: name of .lua script to run as part of the style"
echo " NAME_STYLE: name of the .style to use"
echo " NAME_MML: name of the .mml file to render to mapnik.xml"
echo " NAME_SQL: name of the .sql file to use"
exit 1
fi
@ -36,7 +40,7 @@ fi
if [ ! -f /home/renderer/src/openstreetmap-carto/mapnik.xml ]; then
cd /home/renderer/src/openstreetmap-carto
carto *.mml > mapnik.xml
carto ${NAME_MML:-project.mml} > mapnik.xml
fi
@ -91,10 +95,10 @@ if [ "$1" = "import" ]; then
fi
# Import data
sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/*.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/*.style /data.osm.pbf ${OSM2PGSQL_EXTRA_ARGS:-}
sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/${NAME_LUA:-openstreetmap-carto.lua} --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/${NAME_STYLE:-openstreetmap-carto.style} /data.osm.pbf ${OSM2PGSQL_EXTRA_ARGS:-}
# Create indexes
sudo -u postgres psql -d gis -f /home/renderer/src/openstreetmap-carto/*.sql
sudo -u postgres psql -d gis -f /home/renderer/src/openstreetmap-carto/${NAME_SQL:-indexes.sql}
#Import external data
sudo chown -R renderer: /home/renderer/src