Compare commits

...
2 changed files with 46 additions and 10 deletions
+16
View File
@@ -19,3 +19,19 @@ XML=/data/style/mapnik.xml
HOST=localhost
TILESIZE=256
MAXZOOM=20
[osmbe_nl]
URI=/tile_nl/
TILEDIR=/var/cache/renderd/tiles
XML=/data/style/mapnik-nl.xml
HOST=localhost
TILESIZE=256
MAXZOOM=20
[osmbe_fr]
URI=/tile_fr/
TILEDIR=/var/cache/renderd/tiles
XML=/data/style/mapnik-fr.xml
HOST=localhost
TILESIZE=256
MAXZOOM=20
+30 -10
View File
@@ -13,8 +13,9 @@ function setPostgresPassword() {
}
function compileStyle() {
local lang="${1:-}"
cd /data/style/
git clone --single-branch --branch update-2024 https://github.com/nobohan/openstreetmap-carto-be --depth 1
git clone --single-branch --branch v6.0.0 https://github.com/osmbe/openstreetmap-carto-be --depth 1
mkdir /data/style/patterns/
mv /data/style/openstreetmap-carto-be/patterns/* /data/style/patterns/
mkdir /data/style/symbols/
@@ -22,11 +23,15 @@ function compileStyle() {
mkdir /data/style/scripts/
mv /data/style/openstreetmap-carto-be/scripts/* /data/style/scripts/
mv /data/style/openstreetmap-carto-be/external-data.yml /data/style/external-data.yml
carto openstreetmap-carto-be/project.mml > mapnik.xml
if [ -z "$lang" ]; then
carto openstreetmap-carto-be/project.mml > mapnik.xml
else
carto "openstreetmap-carto-be/project-${lang}.mml" > mapnik-${lang}.xml
fi
}
if [ "$#" -ne 1 ]; then
if [ "$#" -gt 2 ]; then
echo "usage: <import|run>"
echo "commands:"
echo " import: Set up the database and import /data/region.osm.pbf"
@@ -49,7 +54,11 @@ fi
if [ "$1" == "import" ]; then
compileStyle
if [ "$#" -gt 1 ]; then
compileStyle "$2"
else
compileStyle
fi
# Ensure that database directory is in right state
mkdir -p /data/database/postgres/
@@ -107,7 +116,7 @@ if [ "$1" == "import" ]; then
fi
# 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 \
sudo -u renderer osm2pgsql -d gis --create -O flex -S openstreetmap-carto-be/openstreetmap-carto-flex.lua \
/data/region.osm.pbf \
${OSM2PGSQL_EXTRA_ARGS:-} \
;
@@ -141,7 +150,11 @@ if [ "$1" == "run" ]; then
# Clean /tmp
rm -rf /tmp/*
compileStyle
if [ -z "$2" ]; then
compileStyle $2
else
compileStyle
fi
# migrate old files
if [ -f /data/database/PG_VERSION ] && ! [ -d /data/database/postgres/ ]; then
@@ -207,17 +220,24 @@ fi
if [ "$1" == "generate_tiles" ]; then
compileStyle
if [ -z "$2" ]; then
compileStyle $2
else
compileStyle
fi
service postgresql start
service apache2 restart
sudo -u renderer renderd -c /etc/renderd.conf
render_list --map osmbe -n 36 --min-zoom=0 --max-zoom=7 --all
cat /data/tiles/osmbe/tiles.list | render_list --map osmbe -n 36
if [ -z "$2" ]; then
render_list --map osmbe -n 36 --min-zoom=0 --max-zoom=7 --all
cat /data/tiles/osmbe/tiles.list | render_list --map osmbe -n 36
bash
render_list --map osmbe_${$2} -n 36 --min-zoom=0 --max-zoom=7 --all
cat /data/tiles/osmbe/tiles.list | render_list --map osmbe_${$2} -n 36
bash
fi