source: other-projects/tipple-android/osmosis/script/contrib/replicate_osm_file.sh@ 26899

Last change on this file since 26899 was 26899, checked in by davidb, 11 years ago

Tipple reborn after Chris's Summer of Code 2013

File size: 1.0 KB
Line 
1#!/bin/sh
2
3# This script automates the replication of changes into an offline osm file for a specific area of interest. This allows an up-to-date local snapshot of an area to be maintained.
4
5# The name of the replicated file.
6OSM_FILE=myfile.osm.gz
7
8# The name of the temp file to create during processing (Note: must have the same extension as OSM_FILE to ensure the same compression method is used.
9TEMP_OSM_FILE=tmp.osm.gz
10
11# The directory containing the state associated with the --read-change-interval task previously initiated with the --read-change-interval-init task.
12WORKING_DIRECTORY=./
13
14# The bounding box to maintain.
15LEFT=-180
16BOTTOM=-90
17RIGHT=180
18TOP=90
19
20# The osmosis command.
21CMD="osmosis -q"
22
23# Launch the osmosis process.
24$CMD --read-change-interval $WORKING_DIRECTORY --read-xml $OSM_FILE --apply-change --bounding-box left=$LEFT bottom=$BOTTOM right=$RIGHT top=$TOP --write-xml $TEMP_OSM_FILE
25
26# Verify that osmosis ran successfully.
27if [ "$?" -ne "0" ]; then
28
29 echo "Osmosis failed, aborting."
30 exit -1
31
32fi
33
34mv $TEMP_OSM_FILE $OSM_FILE
35
Note: See TracBrowser for help on using the repository browser.