Merge develop

This commit is contained in:
Pieter Vander Vennet 2024-09-02 12:08:22 +02:00
commit bcd53405c8
197 changed files with 5675 additions and 5188 deletions

View file

@ -94,7 +94,7 @@ export class OsmPoiDatabase {
let latestDate: Date = undefined
for (const name of dbs) {
const date = new Date(name)
if (latestDate.getTime() < date.getTime()) {
if (latestDate === undefined || latestDate.getTime() < date.getTime()) {
latest = name
latestDate = date
}
@ -104,7 +104,7 @@ export class OsmPoiDatabase {
}
console.log("Latest database is:", latest)
return latest
return "osm-poi."+latest
}
async createNew(date: string) {

View file

@ -1,18 +1,23 @@
#! /bin/bash
# Full database update. DOwnload latest from planet.osm.org, build update script, setup and seed it
# Full database update. Downloads the latest from planet.osm.org, build update script, setup and seed it
# Meant to be run with 'nohup'
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
@ -20,7 +25,10 @@ osm2pgsql -O flex -S build_db.lua -s --flat-nodes=import-help-file -d postgresql
# To see the progress
# tail -f seeddb.log
cd ~/git/MapComplete || exit
npm run delete:database:old
nohup npm run server:summary >> summary_server.log &
cd - || exit
# Restart tileserver
export DATABASE_URL=postgresql://user:password@localhost:5444/osm-poi.${DATE}