From 99bf415e01225a3e86c1174c4027ec6e88e7d8c1 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 2 Sep 2024 01:24:38 +0200 Subject: [PATCH] Fixes to update script --- scripts/osm2pgsql/update.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/osm2pgsql/update.sh b/scripts/osm2pgsql/update.sh index c9de47f1e..d88f89606 100755 --- a/scripts/osm2pgsql/update.sh +++ b/scripts/osm2pgsql/update.sh @@ -6,14 +6,18 @@ nvm use npm run init # contains a 'npm run generate, which builds the layers' npm run generate:buildDbScript mv build_db.lua ~/data/ + + +cd ~/data || exit +rm planet-latest.osm.pbf + +wget https://planet.osm.org/pbf/planet-latest.osm.pbf + TIMESTAMP=$(osmium fileinfo ~/data/planet-latest.osm.pbf -g header.option.timestamp) DATE=$(echo $TIMESTAMP | sed "s/T.*//") echo $DATE npm run create:database -- -- ${DATE/T.*//} -cd ~/data || exit -rm planet-latest.osm.pbf -wget https://planet.osm.org/pbf/planet-latest.osm.pbf rm seeddb.log osm2pgsql -O flex -S build_db.lua -s --flat-nodes=import-help-file -d postgresql://user:password@localhost:5444/osm-poi planet-latest.osm.pbf >> seeddb.log