From c2b79805a0d4c98d9d5c91216c0471c4615a3ed5 Mon Sep 17 00:00:00 2001 From: nobohan Date: Sun, 25 Jun 2023 17:40:32 +0200 Subject: [PATCH] adapt renderd.conf and add compilation of cyclosm style --- cyclosm/renderd.conf | 21 +++++++++++++++++++++ docker-compose.yml | 1 + run.sh | 8 +++++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cyclosm/renderd.conf diff --git a/cyclosm/renderd.conf b/cyclosm/renderd.conf new file mode 100644 index 0000000..722e99a --- /dev/null +++ b/cyclosm/renderd.conf @@ -0,0 +1,21 @@ +; BASIC AND SIMPLE CONFIGURATION: + +[renderd] +stats_file=/run/renderd/renderd.stats +socketname=/run/renderd/renderd.sock +num_threads=4 +tile_dir=/var/cache/renderd/tiles + +[mapnik] +plugins_dir=/usr/lib/mapnik/3.1/input +font_dir=/usr/share/fonts +font_dir_recurse=true + +; ADD YOUR LAYERS: +[default] +URI=/tile/ +TILEDIR=/var/cache/renderd/tiles +XML=/data/style/mapnik.xml +HOST=localhost +TILESIZE=256 +MAXZOOM=20 diff --git a/docker-compose.yml b/docker-compose.yml index a2f2d47..e7b9850 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: #- osm-data:/data/database/ - ./database:/data/database/ - ./tiles:/data/tiles/ + - ./cyclosm/renderd.conf:/etc/renderd.conf - ./run.sh:/run.sh # for dev - ./pbf/luxembourg-latest.osm.pbf:/data/region.osm.pbf # change here your pbf - ./pbf/luxembourg.poly:/data/region.poly # and your poly diff --git a/run.sh b/run.sh index 458e9c1..f318b49 100755 --- a/run.sh +++ b/run.sh @@ -129,6 +129,12 @@ if [ "$1" == "run" ]; then # Clean /tmp rm -rf /tmp/* + 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 + + # migrate old files if [ -f /data/database/PG_VERSION ] && ! [ -d /data/database/postgres/ ]; then mkdir /data/database/postgres/ @@ -164,7 +170,7 @@ if [ "$1" == "run" ]; then setPostgresPassword # Configure renderd threads - sed -i -E "s/num_threads=[0-9]+/num_threads=${THREADS:-4}/g" /etc/renderd.conf + #sed -i -E "s/num_threads=[0-9]+/num_threads=${THREADS:-4}/g" /etc/renderd.conf # start cron job to trigger consecutive updates if [ "${UPDATES:-}" == "enabled" ] || [ "${UPDATES:-}" == "1" ]; then