Allow easier modification of the OpenStreetMap-carto style (#243)

This commit is contained in:
galewis2
2022-03-31 07:44:56 -04:00
committed by GitHub
parent f1203714c1
commit 0f229a0cbd
4 changed files with 66 additions and 21 deletions

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/openstreetmap-carto.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/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
@@ -30,7 +30,6 @@ OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore --tag-transform-script /home/renderer/
#------------------------------------------------------------------------------
TRIM_POLY_FILE="/var/lib/mod_tile/data.poly"
TRIM_OPTIONS="-d $DBNAME"
#TRIM_REGION_OPTIONS="-b -14.17 48.85 2.12 61.27"
TRIM_REGION_OPTIONS="-p $TRIM_POLY_FILE"
BASE_DIR=/var/lib/mod_tile
@@ -107,9 +106,12 @@ freelock()
if [ $# -eq 1 ] ; then
m_info "Initialising Osmosis replication system to $1"
mkdir $WORKOSM_DIR
mkdir -p $WORKOSM_DIR
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG"
wget "https://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt
mv $WORKOSM_DIR/configuration.txt $WORKOSM_DIR/configuration_orig.txt
sed "s!baseUrl=http://planet.openstreetmap.org/replication/minute!baseUrl=https://planet.openstreetmap.org/replication/minute!" $WORKOSM_DIR/configuration_orig.txt > $WORKOSM_DIR/configuration.txt
else
@@ -167,12 +169,12 @@ fi
#------------------------------------------------------------------------------
# The lockfile is normally removed before we expire tiles because that is
# something thatcan be done in parallel with further processing. In order to
# something that can be done in parallel with further processing. In order to
# avoid rework, if actually rerendering is done rather than just deleting or
# dirtying, it makes sense to move it lower down.
#------------------------------------------------------------------------------
# m_ok "Import complete; removing lock file"
# freelock "$LOCK_FILE"
# m_ok "Import complete; removing lock file"
# freelock "$LOCK_FILE"
m_ok "expiring tiles"
#------------------------------------------------------------------------------
@@ -194,11 +196,8 @@ fi
# Only remove the lock file after expiry (if system is slow we want to delay
# the next import, not have multiple render_expired processes running)
#------------------------------------------------------------------------------
freelock "$LOCK_FILE"
freelock "$LOCK_FILE"
m_ok "Done with import"
fi