Skip to content

Commit 31bf2d7

Browse files
committed
Add a way to enable options like --flat-nodes (fixes #53)
1 parent fcc6168 commit 31bf2d7

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ docker run \
9494
-d overv/openstreetmap-tile-server \
9595
run
9696
```
97+
9798
### AUTOVACUUM
9899

99100
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 \
105106
-d overv/openstreetmap-tile-server \
106107
run
107108
```
109+
110+
### Flat nodes
111+
112+
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:
113+
114+
```
115+
docker run \
116+
-v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \
117+
-v openstreetmap-data:/var/lib/postgresql/10/main \
118+
-e OSM2PGSQL_EXTRA_ARGS=--flat-nodes \
119+
overv/openstreetmap-tile-server \
120+
import
121+
```
122+
108123
### Benchmarks
109124

110125
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 \
129144
```
130145
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.
131146

147+
### The import process unexpectedly exits
148+
149+
You may be running into problems with memory usage during the import. Have a look at the "Flat nodes" section in this README.
150+
132151
## License
133152

134153
```

run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if [ "$1" = "import" ]; then
5252
fi
5353

5454
# Import data
55-
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
55+
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
5656

5757
# Create indexes
5858
sudo -u postgres psql -d gis -f indexes.sql
@@ -65,7 +65,7 @@ fi
6565
if [ "$1" = "run" ]; then
6666
# Clean /tmp
6767
rm -rf /tmp/*
68-
68+
6969
# Fix postgres data privileges
7070
chown postgres:postgres /var/lib/postgresql -R
7171

0 commit comments

Comments
 (0)