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.
|
---|
6 | OSM_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.
|
---|
9 | TEMP_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.
|
---|
12 | WORKING_DIRECTORY=./
|
---|
13 |
|
---|
14 | # The bounding box to maintain.
|
---|
15 | LEFT=-180
|
---|
16 | BOTTOM=-90
|
---|
17 | RIGHT=180
|
---|
18 | TOP=90
|
---|
19 |
|
---|
20 | # The osmosis command.
|
---|
21 | CMD="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.
|
---|
27 | if [ "$?" -ne "0" ]; then
|
---|
28 |
|
---|
29 | echo "Osmosis failed, aborting."
|
---|
30 | exit -1
|
---|
31 |
|
---|
32 | fi
|
---|
33 |
|
---|
34 | mv $TEMP_OSM_FILE $OSM_FILE
|
---|
35 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.