Fixes to update script

This commit is contained in:
Pieter Vander Vennet 2024-09-02 01:24:38 +02:00
parent f448eff73d
commit 99bf415e01

View file

@ -6,14 +6,18 @@ nvm use
npm run init # contains a 'npm run generate, which builds the layers' npm run init # contains a 'npm run generate, which builds the layers'
npm run generate:buildDbScript npm run generate:buildDbScript
mv build_db.lua ~/data/ 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) TIMESTAMP=$(osmium fileinfo ~/data/planet-latest.osm.pbf -g header.option.timestamp)
DATE=$(echo $TIMESTAMP | sed "s/T.*//") DATE=$(echo $TIMESTAMP | sed "s/T.*//")
echo $DATE echo $DATE
npm run create:database -- -- ${DATE/T.*//} 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 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 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