Add a way to enable options like --flat-nodes (fixes #53)

This commit is contained in:
Alexander Overvoorde 2019-08-20 19:40:24 +02:00
parent fcc6168253
commit 31bf2d718b
2 changed files with 21 additions and 2 deletions

View File

@ -94,6 +94,7 @@ docker run \
-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:
@ -105,6 +106,20 @@ docker run \
-d overv/openstreetmap-tile-server \
run
```
### 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 as follows:
```
docker run \
-v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \
-v openstreetmap-data:/var/lib/postgresql/10/main \
-e OSM2PGSQL_EXTRA_ARGS=--flat-nodes \
overv/openstreetmap-tile-server \
import
```
### 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).
@ -129,6 +144,10 @@ docker run \
```
For too high values you may notice excessive CPU load and memory usage. It might be that you will have to experimentally find the best values for yourself.
### The import process unexpectedly exits
You may be running into problems with memory usage during the import. Have a look at the "Flat nodes" section in this README.
## License
```

2
run.sh
View File

@ -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} -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 -C 2048 --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