You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes:
- /var/lib/postgresql/14/main/ => /data/database/
- /var/lib/mod_tile/ => /data/tiles/
- /home/renderer/src/openstreetmap-carto/ => /data/style/
- /data.osm.pbf => /data/region.osm.pbf
- /data.poly => /data/region.poly
- /nodes/flat_nodes.bin => deprecated (use FLAT_NODES=enabled instead)
Because some files are needed later and should never be separated from the database, the import does save those files now into /data/databases/:
- /data/database/region.poly
- /data/database/flat_nodes.bin
- /data/database/planet-import-complete
- and automatic update artifacts
Copy file name to clipboardExpand all lines: README.md
+36-37Lines changed: 36 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,41 +9,43 @@ This container allows you to easily set up an OpenStreetMap PNG tile server give
9
9
10
10
First create a Docker volume to hold the PostgreSQL database that will contain the OpenStreetMap data:
11
11
12
-
docker volume create openstreetmap-data
12
+
docker volume create osm-data
13
13
14
-
Next, download an .osm.pbf extract from geofabrik.de for the region that you're interested in. You can then start importing it into PostgreSQL by running a container and mounting the file as `/data.osm.pbf`. For example:
14
+
Next, download an `.osm.pbf` extract from geofabrik.de for the region that you're interested in. You can then start importing it into PostgreSQL by running a container and mounting the file as `/data/region.osm.pbf`. For example:
If the container exits without errors, then your data has been successfully imported and you are now ready to run the tile server.
25
25
26
-
Note that the import process requires an internet connection. The run process does not require an internet connection. If you want to run the openstreetmap-tile server on a computer that is isolated, you must first import on an internet connected computer, export the openstreetmap-data volume as a tarfile, and then restore the data volume on the target computer system.
26
+
Note that the import process requires an internet connection. The run process does not require an internet connection. If you want to run the openstreetmap-tile server on a computer that is isolated, you must first import on an internet connected computer, export the `osm-data` volume as a tarfile, and then restore the data volume on the target computer system.
27
27
28
-
Also when running on an isolated system, the default index.html from the container will not work, as it requires access to the web for the leaflet packages.
28
+
Also when running on an isolated system, the default `index.html` from the container will not work, as it requires access to the web for the leaflet packages.
29
29
30
30
### Automatic updates (optional)
31
31
32
-
If your import is an extract of the planet and has polygonal bounds associated with it, like those from geofabrik.de, then it is possible to set your server up for automatic updates. Make sure to reference both the OSM file and the polygon file during the import process to facilitate this, and also include the `UPDATES=enabled` variable:
32
+
If your import is an extract of the planet and has polygonal bounds associated with it, like those from [geofabrik.de](https://download.geofabrik.de/), then it is possible to set your server up for automatic updates. Make sure to reference both the OSM file and the polygon file during the `import` process to facilitate this, and also include the `UPDATES=enabled` variable:
Refer to the section *Automatic updating and tile expiry* to actually enable the updates while running the tile server.
46
45
46
+
Please note: If you're not importing the whole planet, then the `.poly` file is necessary to limit automatic updates to the relevant region.
47
+
Therefore, when you only have a `.osm.pbf` file but not a `.poly` file, you should not enable automatic updates.
48
+
47
49
### Letting the container download the file
48
50
49
51
It is also possible to let the container download files for you rather than mounting them in advance by using the `DOWNLOAD_PBF` and `DOWNLOAD_POLY` parameters:
@@ -52,7 +54,7 @@ It is also possible to let the container download files for you rather than moun
If you do not define the "NAME_*" variables, the script will default to those found in the openstreetmap-carto style.
79
81
80
-
Be sure to mount the volume during `run` with the same `-v /home/user/openstreetmap-carto-modified:/home/renderer/src/openstreetmap-carto`
82
+
Be sure to mount the volume during `run` with the same `-v /home/user/openstreetmap-carto-modified:/data/style/`
81
83
82
84
If you do not see the expected style upon `run` double check your paths as the style may not have been found at the directory specified. By default, `openstreetmap-carto` will be used if a style cannot be found
@@ -103,19 +105,19 @@ The `docker-compose.yml` file included with this repository shows how the aforem
103
105
104
106
### Preserving rendered tiles
105
107
106
-
Tiles that have already been rendered will be stored in `/var/lib/mod_tile`. To make sure that this data survives container restarts, you should create another volume for it:
108
+
Tiles that have already been rendered will be stored in `/data/tiles/`. To make sure that this data survives container restarts, you should create another volume for it:
**If you do this, then make sure to also run the import with the `openstreetmap-rendered-tiles` volume to make sure that caching works properly across updates!**
120
+
**If you do this, then make sure to also run the import with the `osm-tiles` volume to make sure that caching works properly across updates!**
119
121
120
122
### Enabling automatic updating (optional)
121
123
@@ -125,8 +127,8 @@ Given that you've set up your import as described in the *Automatic updates* sec
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:
>Note that if you use a folder other than `/nodes` then you must make sure that you manually set the owner to `renderer`!
235
-
236
235
### Benchmarks
237
236
238
237
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).
@@ -250,7 +249,7 @@ To raise it use `--shm-size` parameter. For example:
0 commit comments