X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/67928d8183e7049bbc3e846ca7c24753aae0ac9c..a26f6449c8b87623ecce4651b4d769b2301bf564:/cookbooks/taginfo/templates/default/update-planet.erb diff --git a/cookbooks/taginfo/templates/default/update-planet.erb b/cookbooks/taginfo/templates/default/update-planet.erb index 76b7af273..2eaf6fbb3 100644 --- a/cookbooks/taginfo/templates/default/update-planet.erb +++ b/cookbooks/taginfo/templates/default/update-planet.erb @@ -10,10 +10,14 @@ set -e PLANETDIR="<%= @directory %>/planet" LOGDIR="${PLANETDIR}/log" -PLANETOLD="${PLANETDIR}/planet.pbf" +PLANETPREV="${PLANETDIR}/planet-previous.pbf" +PLANETCURR="${PLANETDIR}/planet.pbf" PLANETNEW="${PLANETDIR}/planet-new.pbf" STATEDIR="${PLANETDIR}/replication" OSCFILE="${PLANETDIR}/$(date +%Y%m%d-%H%M).osc" +OSCFILEPREV="${PLANETDIR}/previous.osc" + +OSMIUM=<%= @directory %>/osmium-tool/build/src/osmium # start logging @@ -31,12 +35,14 @@ fi # osc file is ready, create new planet file -osmosis --read-xml-change "$OSCFILE" --read-bin "$PLANETOLD" --buffer bufferCapacity=12000 --apply-change --buffer bufferCapacity=12000 --write-pbf file="$PLANETNEW" +#osmosis --read-xml-change "$OSCFILE" --read-bin "$PLANETCURR" --buffer bufferCapacity=12000 --apply-change --buffer bufferCapacity=12000 --write-pbf file="$PLANETNEW" +$OSMIUM apply-changes --verbose --remove-deleted --simplify --fsync --output=$PLANETNEW $PLANETCURR $OSCFILE # cleanup -mv "$PLANETNEW" "$PLANETOLD" -rm "$OSCFILE" +mv "$PLANETCURR" "$PLANETPREV" +mv "$PLANETNEW" "$PLANETCURR" +mv "$OSCFILE" "$OSCFILEPREV" # expire old logs