forked from MapComplete/MapComplete
Update scripts
This commit is contained in:
parent
6f85db291a
commit
31629b94b8
2 changed files with 12 additions and 8 deletions
|
@ -122,7 +122,10 @@
|
||||||
"server:studio": "vite-node scripts/studioServer -- /root/git/MapComplete/assets",
|
"server:studio": "vite-node scripts/studioServer -- /root/git/MapComplete/assets",
|
||||||
"server:errorreport": "vite-node scripts/serverErrorReport.ts -- /root/error_reports/",
|
"server:errorreport": "vite-node scripts/serverErrorReport.ts -- /root/error_reports/",
|
||||||
"generate:buildDbScript": "vite-node scripts/osm2pgsql/generateBuildDbScript.ts",
|
"generate:buildDbScript": "vite-node scripts/osm2pgsql/generateBuildDbScript.ts",
|
||||||
"generate:summaryCache": "vite-node scripts/generateSummaryTileCache.ts"
|
"generate:summaryCache": "vite-node scripts/generateSummaryTileCache.ts",
|
||||||
|
"create:database": "vite-node scripts/osm2pgsql/createNewDatabase.ts",
|
||||||
|
"delete:database:old": "vite-node scripts/osm2pgsql/deleteOldDbs.ts"
|
||||||
|
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"OpenStreetMap",
|
"OpenStreetMap",
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
# Full database update. DOwnload latest from planet.osm.org, build update script, setup and seed it
|
# Full database update. DOwnload latest from planet.osm.org, build update script, setup and seed it
|
||||||
|
nvm use
|
||||||
npm run init
|
npm run init # contains a 'npm run generate, which builds the layers'
|
||||||
npm run generate
|
|
||||||
npm run refresh:layeroverview
|
|
||||||
npm run generate:buildDbScript
|
npm run generate:buildDbScript
|
||||||
mv build_db.sh ~/data/
|
mv build_db.lua ~/data/
|
||||||
TIMESTAMP=$(osmium fileinfo 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.*//")
|
||||||
vite-node scripts/osm2pgsql/createNewDatabase.ts -- ${DATE/T.*//}
|
echo $DATE
|
||||||
|
npm run create:database -- ${DATE/T.*//}
|
||||||
|
|
||||||
cd ~/data || exit
|
cd ~/data || exit
|
||||||
rm planet-latest.osm.pbf
|
rm planet-latest.osm.pbf
|
||||||
|
@ -21,6 +20,8 @@ nohup osm2pgsql -O flex -S build_db.lua -s --flat-nodes=import-help-file -d post
|
||||||
# To see the progress
|
# To see the progress
|
||||||
# tail -f seeddb.log
|
# tail -f seeddb.log
|
||||||
|
|
||||||
|
npm run delete:database:old
|
||||||
|
|
||||||
# Restart tileserver
|
# Restart tileserver
|
||||||
export DATABASE_URL=postgresql://user:password@localhost:5444/osm-poi.${DATE}
|
export DATABASE_URL=postgresql://user:password@localhost:5444/osm-poi.${DATE}
|
||||||
nohup ./pg_tileserv >> pg_tileserv.log &
|
nohup ./pg_tileserv >> pg_tileserv.log &
|
||||||
|
|
Loading…
Reference in a new issue