From c5a6462263af7fd88f06c0d6f4fa073db74c08e8 Mon Sep 17 00:00:00 2001 From: Steffen Volkmann Date: Wed, 18 Sep 2019 09:52:09 +0200 Subject: [PATCH 1/3] add OSM2PGSQL_EXTRA_ARGS to arguments of osm2psql call insight openstreetmap-tiles-update-expire script --- openstreetmap-tiles-update-expire | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstreetmap-tiles-update-expire b/openstreetmap-tiles-update-expire index dea6e9e..6958f64 100644 --- a/openstreetmap-tiles-update-expire +++ b/openstreetmap-tiles-update-expire @@ -22,7 +22,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 -C 2048 --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style" +OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore ${OSM2PGSQL_EXTRA_ARGS} --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua -C 2048 --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style" #------------------------------------------------------------------------------ # When using trim_osc.py we can define either a bounding box (such as this From 33cd14285025cc236d65f2faaac06574020fbdf1 Mon Sep 17 00:00:00 2001 From: Steffen Volkmann Date: Wed, 18 Sep 2019 10:19:58 +0200 Subject: [PATCH 2/3] make option -C of command osm2psql adjustable --- README.md | 12 ++++++++++++ openstreetmap-tiles-update-expire | 2 +- run.sh | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8efc32..7d6465c 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,18 @@ docker run \ run ``` +### CACHE + +The import and tile serving processes use 800 MB RAM cache by default, but this number can be changed by option -C. For example: +``` +docker run \ + -p 80:80 \ + -e "OSM2PGSQL_EXTRA_ARGS=-C 4096" \ + -v openstreetmap-data:/var/lib/postgresql/10/main \ + -d overv/openstreetmap-tile-server \ + run +``` + ### AUTOVACUUM The database use the autovacuum feature by default. This behavior can be changed with `AUTOVACUUM` environment variable. For example: diff --git a/openstreetmap-tiles-update-expire b/openstreetmap-tiles-update-expire index 6958f64..9e495f6 100644 --- a/openstreetmap-tiles-update-expire +++ b/openstreetmap-tiles-update-expire @@ -22,7 +22,7 @@ OSM2PGSQL_BIN=osm2pgsql TRIM_BIN=/home/$ACCOUNT/src/regional/trim_osc.py DBNAME=gis -OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore ${OSM2PGSQL_EXTRA_ARGS} --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua -C 2048 --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style" +OSM2PGSQL_OPTIONS="-d $DBNAME -G --hstore ${OSM2PGSQL_EXTRA_ARGS} --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua --number-processes ${THREADS:-4} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style" #------------------------------------------------------------------------------ # When using trim_osc.py we can define either a bounding box (such as this diff --git a/run.sh b/run.sh index 857d847..b6918fb 100755 --- a/run.sh +++ b/run.sh @@ -52,7 +52,7 @@ 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/openstreetmap-carto.lua -C 2048 --number-processes ${THREADS:-4} ${OSM2PGSQL_EXTRA_ARGS} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style /data.osm.pbf + sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script /home/renderer/src/openstreetmap-carto/openstreetmap-carto.lua --number-processes ${THREADS:-4} ${OSM2PGSQL_EXTRA_ARGS} -S /home/renderer/src/openstreetmap-carto/openstreetmap-carto.style /data.osm.pbf # Create indexes sudo -u postgres psql -d gis -f indexes.sql From bea77eb8bf8f3c3a3e799cfdf5e380fa7b6daa94 Mon Sep 17 00:00:00 2001 From: Steffen Volkmann Date: Tue, 24 Sep 2019 11:30:54 +0200 Subject: [PATCH 3/3] Dockerfile: create directory for flatnodes and change owner of directory to renderer --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3b091b5..d1bf5b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,6 +87,8 @@ RUN cmake .. \ && make -j $(nproc) USER root RUN make install +RUN mkdir /nodes \ + && chown renderer:renderer /nodes USER renderer # Install and test Mapnik