source: subversion/applications/utils/debian/osmosis.sh @ 4581

Last change on this file since 4581 was 4581, checked in by joerg, 12 years ago

add osmosis to utils package

File size: 1.9 KB
Line 
1#!/bin/sh
2
3if [ "$@" = "--help" \
4    -o  "$@" = "-help" \
5    -o  "$@" = "-h" \
6    -o  "$@" = "-?" \
7    ]; then
8cat <<EOF
9osmosis
10
11Example Usage
12
13Import a planet file into a local MySQL database.
14
15osmosis --read-xml file=~/osm/planbet/planet.osm --write-mysql host="x" database="x" user="x" password="x"
16
17Export a planet file from a local MySQL database.
18
19osmosis --read-mysql host="x" database="x" user="x" password="x" --write-xml file="planet.osm"
20
21Derive a change set between two planet files.
22
23osmosis --read-xml file="planet1.osm" --read-xml file="planet2.osm" --derive-change --write-xml-change file="planetdiff-1-2.osc"
24
25Derive a change set between a planet file and a database.
26
27osmosis --read-xml file="planet1.osm" --read-mysql host="x" database="x" user="x" password="x" --derive-change --write-xml-change file="planetdiff-1-2.osc"
28
29Apply a change set to a planet file.
30
31osmosis --read-xml file="planet1.osm" --read-xml-change file="planetdiff-1-2.osc" --apply-change --write-xml file="planet2.osm"
32
33Sort the contents of a planet file.
34
35osmosis --read-xml file="data.osm" --sort type="TypeThenId" --write-xml file="data-sorted.osm"
36
37The above examples make use of the default pipe connection feature, however a simple read and write planet file command line could be written in two ways. The first example uses default pipe connection, the second explicitly connects the two components using a pipe named "mypipe". The default pipe connection will always work so long as each task is specified in the correct order.
38
39osmosis --read-xml file="planetin.osm" --write-xml file="planetout.osm"
40
41osmosis --read-xml file="planetin.osm" outPipe.0="mypipe" --write-xml file="planetout.osm" inPipe.0="mypipe"
42[edit] Detailed Usage
43
44Full usage details are available at: http://www.bretth.com/wiki/Wiki.jsp?page=OpenStreetMap
45
46EOF
47else
48    java -jar /usr/local/share/osmosis/osmosis.jar "$@"
49fi
Note: See TracBrowser for help on using the repository browser.