Improve consistency of parameter naming and document PBF/POLY download parameters

This commit is contained in:
Alexander Overvoorde 2020-02-20 20:29:14 +01:00
parent e15dee4665
commit acedcce53d
2 changed files with 23 additions and 10 deletions

View File

@ -38,6 +38,19 @@ docker run \
Refer to the section *Automatic updating and tile expiry* to actually enable the updates while running the tile server.
### Letting the container download the file
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:
```
docker run \
-e DOWNLOAD_PBF=http://download.geofabrik.de/europe/luxembourg-latest.osm.pbf \
-e DOWNLOAD_POLY=http://download.geofabrik.de/europe/luxembourg.poly \
-v openstreetmap-data:/var/lib/postgresql/12/main \
overv/openstreetmap-tile-server \
import
```
## Running the server
Run the server like this:

20
run.sh
View File

@ -42,18 +42,18 @@ if [ "$1" = "import" ]; then
setPostgresPassword
# Download Luxembourg as sample if no data is provided
if [ ! -f /data.osm.pbf ] && [ -z "$DL_PBF" ]; then
if [ ! -f /data.osm.pbf ] && [ -z "$DOWNLOAD_PBF" ]; then
echo "WARNING: No import file at /data.osm.pbf, so importing Luxembourg as example..."
DL_PBF="http://download.geofabrik.de/europe/luxembourg-latest.osm.pbf"
DL_PBF_POLY="http://download.geofabrik.de/europe/luxembourg.poly"
DOWNLOAD_PBF="http://download.geofabrik.de/europe/luxembourg-latest.osm.pbf"
DOWNLOAD_POLY="http://download.geofabrik.de/europe/luxembourg.poly"
fi
if [ -n "$DL_PBF" ]; then
echo "INFO: Download PBF file: $DL_PBF"
wget -nv "$DL_PBF" -O /data.osm.pbf
if [ -n "$DL_PBF_POLY" ]; then
echo "INFO: Download PBF-POLY file: $DL_PBF_POLY"
wget -nv "$DL_PBF_POLY" -O /data.poly
if [ -n "$DOWNLOAD_PBF" ]; then
echo "INFO: Download PBF file: $DOWNLOAD_PBF"
wget -nv "$DOWNLOAD_PBF" -O /data.osm.pbf
if [ -n "$DOWNLOAD_POLY" ]; then
echo "INFO: Download PBF-POLY file: $DOWNLOAD_POLY"
wget -nv "$DOWNLOAD_POLY" -O /data.poly
fi
fi