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

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

osmosis.sh: correct command line parsing

File size: 1.9 KB
Line 
1#!/bin/sh
2
3if [ "x$@" = "x" ] \
4    || [ "x$@" = 'x--help' ] \
5    || [ "x$@" = 'x-help' ] \
6    || [ "x$@" = "x-h" ]  \
7    || [ "x$@" = "x-?" ] \
8    || [ "x$@" = "x-help" ]; then
9cat <<EOF
10osmosis
11
12Example Usage
13
14Import a planet file into a local MySQL database.
15
16osmosis --read-xml file=~/osm/planbet/planet.osm --write-mysql host="x" database="x" user="x" password="x"
17
18Export a planet file from a local MySQL database.
19
20osmosis --read-mysql host="x" database="x" user="x" password="x" --write-xml file="planet.osm"
21
22Derive a change set between two planet files.
23
24osmosis --read-xml file="planet1.osm" --read-xml file="planet2.osm" --derive-change --write-xml-change file="planetdiff-1-2.osc"
25
26Derive a change set between a planet file and a database.
27
28osmosis --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"
29
30Apply a change set to a planet file.
31
32osmosis --read-xml file="planet1.osm" --read-xml-change file="planetdiff-1-2.osc" --apply-change --write-xml file="planet2.osm"
33
34Sort the contents of a planet file.
35
36osmosis --read-xml file="data.osm" --sort type="TypeThenId" --write-xml file="data-sorted.osm"
37
38The 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.
39
40osmosis --read-xml file="planetin.osm" --write-xml file="planetout.osm"
41
42osmosis --read-xml file="planetin.osm" outPipe.0="mypipe" --write-xml file="planetout.osm" inPipe.0="mypipe"
43[edit] Detailed Usage
44
45Full usage details are available at: http://www.bretth.com/wiki/Wiki.jsp?page=OpenStreetMap
46
47EOF
48else
49    java -jar /usr/local/share/osmosis/osmosis.jar "$@"
50fi
Note: See TracBrowser for help on using the repository browser.