From 466c5a67eb9f401a498315e793ce99da22fa98b6 Mon Sep 17 00:00:00 2001 From: typebrook Date: Wed, 27 Nov 2019 09:55:12 +0800 Subject: update --- scripts/osm/osm.pbf.update | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/osm') diff --git a/scripts/osm/osm.pbf.update b/scripts/osm/osm.pbf.update index 117276c..cd115a7 100755 --- a/scripts/osm/osm.pbf.update +++ b/scripts/osm/osm.pbf.update @@ -7,11 +7,13 @@ PBF_FILE=$1 echo Fetching the latest sequence number LATEST_SEQ=$(curl --silent http://download.geofabrik.de/asia/taiwan-updates/state.txt |\ tail -1 | cut -d'=' -f2) +echo Latest sequence number is $LATEST_SEQ # get current sequence number SEQ=$(osmium fileinfo $PBF_FILE |\ grep osmosis_replication_sequence_number |\ cut -d'=' -f2) +echo File sequence number is $SEQ # while server has osc file with given sequence number, # get it and do file update @@ -20,6 +22,7 @@ while [ $SEQ -le $LATEST_SEQ ] do mkdir -p changes + SEQ_PATH=$(echo $SEQ | sed -r 's/(.{1})(.{3})/00\1\/\2/') CHANGE_URL=$GEOFABRICK_SERVER/000/$SEQ_PATH.osc.gz echo $CHANGE_URL curl -o changes/$SEQ.osc.gz $CHANGE_URL && \ -- cgit v1.2.3-70-g09d2