Compare commits

...

7 Commits

Author SHA1 Message Date
Alexander Overvoorde
598a48145a Merge pull request #71 from stevo01/master
use carto version 0.18.2 to solve carto conflicts / warnings
2019-09-29 16:46:17 +02:00
Steffen Volkmann
d106610e05 use carto version 0.18.2 to solve carto conflicts / warnings 2019-09-27 05:55:13 +02:00
Alexander Overvoorde
ff8655701e Update instructions for flat node usage 2019-09-26 20:09:02 +02:00
Alexander Overvoorde
a2eceb6bb5 Merge pull request #66 from stevo01/master
pull request solves issues #63 #64 #65
2019-09-26 20:06:48 +02:00
Steffen Volkmann
bea77eb8bf Dockerfile: create directory for flatnodes
and change owner of directory to renderer
2019-09-24 11:36:13 +02:00
Steffen Volkmann
33cd142850 make option -C of command osm2psql adjustable 2019-09-24 11:36:13 +02:00
Steffen Volkmann
c5a6462263 add OSM2PGSQL_EXTRA_ARGS to arguments of osm2psql call insight openstreetmap-tiles-update-expire script 2019-09-24 11:36:13 +02:00
4 changed files with 20 additions and 12 deletions

View File

@@ -87,6 +87,8 @@ RUN cmake .. \
&& make -j $(nproc) && make -j $(nproc)
USER root USER root
RUN make install RUN make install
RUN mkdir /nodes \
&& chown renderer:renderer /nodes
USER renderer USER renderer
# Install and test Mapnik # Install and test Mapnik
@@ -110,7 +112,7 @@ WORKDIR /home/renderer/src
RUN git clone https://github.com/gravitystorm/openstreetmap-carto.git RUN git clone https://github.com/gravitystorm/openstreetmap-carto.git
WORKDIR /home/renderer/src/openstreetmap-carto WORKDIR /home/renderer/src/openstreetmap-carto
USER root USER root
RUN npm install -g carto RUN npm install -g carto@0.18.2
USER renderer USER renderer
RUN carto project.mml > mapnik.xml RUN carto project.mml > mapnik.xml

View File

@@ -139,6 +139,18 @@ docker run \
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 ### AUTOVACUUM
The database use the autovacuum feature by default. This behavior can be changed with `AUTOVACUUM` environment variable. For example: The database use the autovacuum feature by default. This behavior can be changed with `AUTOVACUUM` environment variable. For example:
@@ -153,15 +165,7 @@ docker run \
### Flat nodes ### Flat nodes
If you are planning to import the entire planet or you are running into memory errors then you may want to enable the `--flat-nodes` option for osm2pgsql. This option takes a path to a file that must be persisted so we should first set up a volume with the right permissions: If you are planning to import the entire planet or you are running into memory errors then you may want to enable the `--flat-nodes` option for osm2pgsql. You can then use it during the import process as follows:
```
docker run -it -v openstreetmap-nodes:/nodes --entrypoint=bash overv/openstreetmap-tile-server
$ chown renderer:renderer -R /nodes
$ exit
```
You can then use it during the import process as follows:
``` ```
docker run \ docker run \
@@ -173,6 +177,8 @@ docker run \
import import
``` ```
>Note that if you use a folder other than `/nodes` then you must make sure that you manually set the owner to `renderer`!
### Benchmarks ### Benchmarks
You can find an example of the import performance to expect with this image on the [OpenStreetMap wiki](https://wiki.openstreetmap.org/wiki/Osm2pgsql/benchmarks#debian_9_.2F_openstreetmap-tile-server). You can find an example of the import performance to expect with this image on the [OpenStreetMap wiki](https://wiki.openstreetmap.org/wiki/Osm2pgsql/benchmarks#debian_9_.2F_openstreetmap-tile-server).

View File

@@ -22,7 +22,7 @@ OSM2PGSQL_BIN=osm2pgsql
TRIM_BIN=/home/$ACCOUNT/src/regional/trim_osc.py TRIM_BIN=/home/$ACCOUNT/src/regional/trim_osc.py
DBNAME=gis 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 --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 # When using trim_osc.py we can define either a bounding box (such as this

2
run.sh
View File

@@ -56,7 +56,7 @@ if [ "$1" = "import" ]; then
fi fi
# Import data # 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 # Create indexes
sudo -u postgres psql -d gis -f indexes.sql sudo -u postgres psql -d gis -f indexes.sql