Make setup for automatic updates optional through UPDATES variable
This commit is contained in:
parent
626158f677
commit
64c66a7d0b
@ -22,10 +22,11 @@ If the container exits without errors, then your data has been successfully impo
|
||||
|
||||
### Automatic updates (optional)
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```
|
||||
docker run \
|
||||
-e UPDATES=enabled \
|
||||
-v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \
|
||||
-v /absolute/path/to/luxembourg.poly:/data.poly \
|
||||
-v openstreetmap-data:/var/lib/postgresql/12/main \
|
||||
@ -33,7 +34,7 @@ docker run \
|
||||
import
|
||||
```
|
||||
|
||||
Refer to the section *Automatic updating and tile expiry* to actually enable the updates.
|
||||
Refer to the section *Automatic updating and tile expiry* to actually enable the updates while running the tile server.
|
||||
|
||||
## Running the server
|
||||
|
||||
@ -67,7 +68,7 @@ docker run \
|
||||
|
||||
### Enabling automatic updating (optional)
|
||||
|
||||
Given that you've specified both the OSM data and polygon as specified in the *Automatic updates* section during server setup, you can enable the updating process by setting the variable `UPDATES` to `enabled`:
|
||||
Given that you've set up your import as described in the *Automatic updates* section during server setup, you can enable the updating process by setting the `UPDATES` variable while running your server as well:
|
||||
|
||||
```
|
||||
docker run \
|
||||
|
2
run.sh
2
run.sh
@ -42,6 +42,7 @@ if [ "$1" = "import" ]; then
|
||||
wget -nv http://download.geofabrik.de/europe/luxembourg.poly -O /data.poly
|
||||
fi
|
||||
|
||||
if [ "$UPDATES" = "enabled" ]; then
|
||||
# determine and set osmosis_replication_timestamp (for consecutive updates)
|
||||
osmium fileinfo /data.osm.pbf > /var/lib/mod_tile/data.osm.pbf.info
|
||||
osmium fileinfo /data.osm.pbf | grep 'osmosis_replication_timestamp=' | cut -b35-44 > /var/lib/mod_tile/replication_timestamp.txt
|
||||
@ -49,6 +50,7 @@ if [ "$1" = "import" ]; then
|
||||
|
||||
# initial setup of osmosis workspace (for consecutive updates)
|
||||
sudo -u renderer openstreetmap-tiles-update-expire $REPLICATION_TIMESTAMP
|
||||
fi
|
||||
|
||||
# copy polygon file if available
|
||||
if [ -f /data.poly ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user