allow external PBF file with auto-downloader

This commit is contained in:
Volker von Hoesslin 2020-02-14 11:59:27 +01:00
parent 5300472417
commit 2a69c977c9
1 changed files with 13 additions and 4 deletions

17
run.sh
View File

@ -36,11 +36,20 @@ if [ "$1" = "import" ]; then
setPostgresPassword
# Download Luxembourg as sample if no data is provided
if [ ! -f /data.osm.pbf ]; then
echo "WARNING: No import file at /data.osm.pbf, so importing Luxembourg as example..."
wget -nv http://download.geofabrik.de/europe/luxembourg-latest.osm.pbf -O /data.osm.pbf
wget -nv http://download.geofabrik.de/europe/luxembourg.poly -O /data.poly
if [ ! -f /data.osm.pbf && ! -z "$(DL_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"
fi
if [ -z "$(DL_PBF)" ]; then
echo "INFO: Download PBF file: $DL_PBF"
wget -nv "$(DL_PBF)" -O /data.osm.pbf
if [ -z "$(DL_PBF_POLY)" ]; then
echo "INFO: Download PBF-POLY file: $(DL_PBF_POLY)"
wget -nv "$(DL_PBF_POLY)" -O /data.poly
fi
fi
if [ "$UPDATES" = "enabled" ]; then
# determine and set osmosis_replication_timestamp (for consecutive updates)