Merge branch 'upstream'
[routino] / doc / html / usage.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <HTML>
3
4 <!--
5  Routino documentation - usage
6
7  Part of the Routino routing software.
8
9  This file Copyright 2008-2010 Andrew M. Bishop
10
11  This program is free software: you can redistribute it and/or modify
12  it under the terms of the GNU Affero General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  GNU Affero General Public License for more details.
20
21  You should have received a copy of the GNU Affero General Public License
22  along with this program.  If not, see http://www.gnu.org/licenses/.
23 -->
24
25 <HEAD>
26 <TITLE>Routino : Usage</TITLE>
27 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
28 <LINK href="style.css" type="text/css" rel="stylesheet">
29 </HEAD>
30
31 <BODY>
32
33 <!-- Header Start -->
34
35 <div class="header" align="center">
36
37 <h1>Routino : Usage</h1>
38
39 <hr>
40 </div>
41
42 <!-- Header End -->
43
44 <!-- Content Start -->
45
46 <div class="content">
47
48 <h2><a name="H_1_1"></a>Program Usage</h2>
49
50 There are four programs that make up this software.  The first one takes the
51 planet.osm datafile from OpenStreetMap (or other source of data using the same
52 formats) and converts it into a local database.  The second program uses the
53 database to determine an optimum route between two points.  The third program
54 allows visualisation of the data and statistics to be extracted.  The fourth
55 program is a test program for the tag transformations.
56
57 <h3><a name="H_1_1_1"></a>planetsplitter</h3>
58
59 This program reads in the OSM format XML file and splits it up to create the
60 database that is used for routing.
61
62 <pre class="boxed">
63 Usage: planetsplitter [--help]
64                       [--dir=&lt;dirname&gt;] [--prefix=&lt;name&gt;]
65                       [--sort-ram-size=&lt;size&gt;]
66                       [--tmpdir=&lt;dirname&gt;]
67                       [--parse-only | --process-only]
68                       [--loggable]
69                       [--max-iterations=&lt;number&gt;]
70                       [--tagging=&lt;filename&gt;]
71                       [&lt;filename.osm&gt; ...]
72 </pre>
73
74 <dl>
75   <dt>--help
76   <dd>Prints out the help information.
77   <dt>--dir=&lt;dirname&gt;
78   <dd>Sets the directory name in which to save the results.
79     Defaults to the current directory.
80   <dt>--prefix=&lt;name&gt;
81   <dd>Sets the filename prefix for the files that are created.
82     Defaults to no prefix.
83   <dt>--sort-ram-size=&lt;size&gt;
84   <dd>Specifies the amount of RAM (in MB) to use for sorting the data.  If not
85     specified then 64 MB will be used in slim mode or 256 MB otherwise.
86   <dt>--tmpdir=&lt;dirname&gt;
87   <dd>Specifies the name of the directory to store the temporary disk files.  If
88     not specified then it defaults to either the value of the --dir option or the
89     current directory.
90   <dt>--parse-only
91   <dd>Parse the input files and store them in a temporary file but don't process
92     the data into a routing database.
93   <dt>--process-only
94   <dd>Don't read in any files but process the existing temporary file into the
95     routing database.
96   <dt>--loggable
97   <dd>Print progress messages that are suitable for logging to a file; normally
98     an incrementing counter is printed which is more suitable for realtime
99     display than logging.
100   <dt>--max-iterations=&lt;number&gt;
101   <dd>The maximum number of iterations to use when generating super-nodes and
102     super-segments.  Defaults to 10 which is normally enough.
103   <dt>--tagging=&lt;filename&gt;
104   <dd>Sets the filename containing the list of tagging rules in XML format for
105     the parsing the input files.  If the file doesn't exist then dirname, prefix
106     and "profiles.xml" will be combined and used, if that doesn't exist then the
107     file '/usr/local/share/routino/profiles.xml' (or custom installation
108     location) will be used.
109   <dt>&lt;filename.osm&gt; ...
110   <dd>Specifies the filename(s) to read data from, by default data is read from
111     the standard input.
112 </dl>
113
114 <p>
115 <i>Note: In version 1.4 of Routino the --transport, --not-highway and
116 --not-property options have been removed.  The same functionality can be
117 achieved by editing the tagging rules file to not output unwwanted data.</i>
118
119 <p>
120 <i>Note: In version 1.5 of Routino the --slim option has been removed but at
121 compilation time a separate program called <em>planetsplitter-slim</em> is
122 created that operates in slim mode.  In slim mode the temporary files and
123 database files are read as needed rather than being mapped into memory.  This
124 allows a database size greater than 2 GB on 32-bit machines or usage with little
125 or no virtual memory (e.g. some virtual machines).  The penalty for this is that
126 the program takes about four times as long to run.</i>
127
128 <p>
129 Example usage:
130
131 <pre class="boxed">
132 ./planetsplitter --dir=data --prefix=gb great_britain.osm
133 </pre>
134
135 This will generate the output files 'data/gb-nodes.mem', 'data/gb-segments.mem'
136 and 'data/gb-ways.mem'.
137
138
139 <h3><a name="H_1_1_2"></a>router</h3>
140
141 This program performs the calculation of the optimum routes using the database
142 generated by the planetsplitter program.
143
144 <pre class="boxed">
145 Usage: router [--help | --help-profile | --help-profile-xml |
146                         --help-profile-json | --help-profile-perl ]
147               [--dir=&lt;dirname&gt;] [--prefix=&lt;name&gt;]
148               [--profiles=&lt;filename&gt;] [--translations=&lt;filename&gt;]
149               [--exact-nodes-only]
150               [--loggable | --quiet]
151               [--output-html]
152               [--output-gpx-track] [--output-gpx-route]
153               [--output-text] [--output-text-all]
154               [--output-none]
155               [--profile=&lt;name&gt;]
156               [--transport=&lt;transport&gt;]
157               [--shortest | --quickest]
158               --lon1=&lt;longitude&gt; --lat1=&lt;latitude&gt;
159               --lon2=&lt;longitude&gt; --lon2=&lt;latitude&gt;
160               [ ... --lon99=&lt;longitude&gt; --lon99=&lt;latitude&gt;]
161               [--highway-&lt;highway&gt;=&lt;preference&gt; ...]
162               [--speed-&lt;highway&gt;=&lt;speed&gt; ...]
163               [--property-&lt;property&gt;=&lt;preference&gt; ...]
164               [--oneway=(0|1)]
165               [--weight=&lt;weight&gt;]
166               [--height=&lt;height&gt;] [--width=&lt;width&gt;] [--length=&lt;length&gt;]
167 </pre>
168
169 <dl>
170   <dt>--help
171   <dd>Prints out the help information.
172   <dt>--help-profile
173   <dd>Prints out the selected transport profile (type, speed limits, highway
174     preferences etc.)
175   <dt>--help-profile-xml
176   <dd>Prints out all the loaded profiles as an XML file in the same format that
177     can be loaded in.
178   <dt>--help-profile-json
179   <dd>Prints out all the loaded profiles in JavaScript Object Notation (JSON)
180     format for use in the interactive webpage.
181   <dt>--help-profile-perl
182   <dd>Prints out all the loaded profiles as a Perl object for use in the router
183     CGI.
184   <dt>--dir=&lt;dirname&gt;
185   <dd>Sets the directory name in which to read the local database.
186     Defaults to the current directory.
187   <dt>--prefix=&lt;name&gt;
188   <dd>Sets the filename prefix for the files in the local database.
189     Defaults to no prefix.
190   <dt>--profiles=&lt;filename&gt;
191   <dd>Sets the filename containing the list of routing profiles in XML format.
192     If the file doesn't exist then dirname, prefix and "profiles.xml" will be
193     combined and used, if that doesn't exist then the file
194     '/usr/local/share/routino/profiles.xml' (or custom installation location)
195     will be used.
196   <dt>--translations=&lt;filename&gt;
197   <dd>Sets the filename containing the list of translations in XML format for
198     the output files.  If the file doesn't exist then dirname, prefix and
199     "translations.xml" will be combined and used, if that doesn't exist then the
200     file '/usr/local/share/routino/translations.xml' (or custom installation
201     location) will be used.
202   <dt>--exact-nodes-only
203   <dd>When processing the specified latitude and longitude points only select
204     the nearest node instead of finding the nearest point within a segment
205     (quicker but less accurate unless the points are already near nodes).
206   <dt>--loggable
207   <dd>Print progress messages that are suitable for logging to a file; normally
208     an incrementing counter is printed which is more suitable for realtime
209     display than logging.
210   <dt>--quiet
211   <dd>Don't generate any screen output while running (useful for running in a script).
212   <dt>--language=&lt;lang&gt;
213   <dd>Select the language specified from the file of translations.  If this
214     option is not given and the file exists then the first language in the file
215     will be used.  If this option is not given and no file exists the
216     compiled-in default language (English) will be used.
217   <dt>--output-html
218   <dt>--output-gpx-track
219   <dt>--output-gpx-route
220   <dt>--output-text
221   <dt>--output-text-all
222   <dd>Generate the selected output file formats (HTML, GPX track file, GPX route
223   file, plain text route and/or plain text with all nodes).  If no output is
224   specified then all are generated, specifying any automatically disables those
225   not specified.
226   <dt>--output-none
227   <dd>Do not generate any output or read in any translations files.
228   <dt>--profile=&lt;name&gt;
229   <dd>Specifies the name of the profile to use.
230   <dt>--transport=&lt;transport&gt;
231   <dd>Select the type of transport to use, &lt;transport&gt; can be set to:
232     <ul>
233       <li>foot       = Foot
234       <li>horse      = Horse
235       <li>wheelchair = Wheelchair
236       <li>bicycle    = Bicycle
237       <li>moped      = Moped     (Small motorbike, limited speed)
238       <li>motorbike  = Motorbike
239       <li>motorcar   = Motorcar
240       <li>goods      = Goods     (Small lorry, van)
241       <li>hgv        = HGV       (Heavy Goods Vehicle - large lorry)
242       <li>psv        = PSV       (Public Service Vehicle - bus, coach)
243     </ul>
244     Defaults to 'motorcar', this option also selects the default profile
245     information if the '--profile' option is not given and a profile matching
246     the transport name is found.
247   <dt>--shortest
248   <dd>Find the shortest route between the waypoints.
249   <dt>--quickest
250   <dd>Find the quickest route between the waypoints.
251   <dt>--lon1=&lt;longitude&gt;, --lat1=&lt;latitude&gt;
252   <dt>--lon2=&lt;longitude&gt;, --lat2=&lt;latitude&gt;
253   <dt>... --lon99=&lt;longitude&gt;, --lat99=&lt;latitude&gt;
254   <dd>The location of the waypoints that make up the start, middle and end
255   points of the route.  Up to 99 waypoints can be specified and the route will
256   pass through each of the specified ones in sequence.  The algorithm will use
257   the closest node or point within a segment that allows the specified traffic
258   type.
259   <dt>--highway-&lt;highway&gt;=&lt;preference&gt;
260   <dd>Selects the percentage preference for using each particular type of
261       highway.  The value of &lt;highway&gt; can be selected from:
262     <ul>
263       <li>motorway     = Motorway
264       <li>trunk        = Trunk
265       <li>primary      = Primary
266       <li>secondary    = Secondary
267       <li>tertiary     = Tertiary
268       <li>unclassified = Unclassified
269       <li>residential  = Residential
270       <li>service      = Service
271       <li>track        = Track
272       <li>cycleway     = Cycleway
273       <li>path         = Path
274       <li>steps        = Steps
275       <li>ferry        = Ferry
276     </ul>
277     Default value depends on the profile selected by the --transport option.
278   <dt>--speed-&lt;highway&gt;=&lt;speed&gt;
279   <dd>Selects the speed limit in km/hour for each type of highway.  Default
280       value depends on the profile selected by the --transport option.
281   <dt>--property-&lt;property&gt;=&lt;preference&gt;
282   <dd>Selects the percentage preference for using each particular highway
283       property
284     The value of &lt;property&gt; can be selected from:
285     <ul>
286       <li>paved        = Paved (suitable for normal wheels)
287       <li>multilane    = Multiple lanes
288       <li>bridge       = Bridge
289       <li>tunnel       = Tunnel
290       <li>footroute    = A route marked for foot travel
291       <li>bicycleroute = A route marked for bicycle travel
292     </ul>
293     Default value depends on the profile selected by the --transport option.
294   <dt>--oneway=[0|1]
295   <dd>Selects if the direction of oneway streets are to be obeyed (useful to not
296       obey them when walking).  Default value depends on the profile selected by
297       the --transport option.
298   <dt>--weight=&lt;weight&gt;
299   <dd>Specifies the weight of the mode of transport in tonnes; ensures that the
300       weight limit on the highway is not exceeded.  Default value depends on the
301       profile selected by the --transport option.
302   <dt>--height=&lt;height&gt;
303   <dd>Specifies the height of the mode of transport in metres; ensures that the
304       height limit on the highway is not exceeded.  Default value depends on the
305       profile selected by the --transport option.
306   <dt>--width=&lt;width&gt;
307   <dd>Specifies the width of the mode of transport in metres; ensures that the
308       width limit on the highway is not exceeded.  Default value depends on the
309       profile selected by the --transport option.
310   <dt>--length=&lt;length&gt;
311   <dd>Specifies the length of the mode of transport in metres; ensures that the
312       length limit on the highway is not exceeded.  Default value depends on the
313       profile selected by the --transport option.
314 </dl>
315
316 <p>
317 <i>Note: In version 1.5 of Routino a slim option has been added and at
318 compilation time a separate program called <em>router-slim</em> is created that
319 operates in slim mode.  In slim mode the database files are read as needed
320 rather than being mapped into memory.</i>
321
322 <p>
323 The meaning of the &lt;preference&gt; parameter in the command line options is
324 slightly different for the highway preferences and the property preferences.
325 For the highway preference consider the choice between two possible highways
326 between the start and finish when looking for the shortest route.  If highway A
327 has a preference of 100% and highway B has a preference of 90% then highway A
328 will be chosen even if it is up to 11% longer (100/90 = 111%).  For the highway
329 properties each highway either has a particular property or not.  If the
330 preference for the property is 60% then a highway with the property has a
331 preference of 77% (sqrt(60%)) and one without has a preference of 63%
332 (sqrt(100-60%)).  A highway with the property will be chosen even if it is up to
333 22% longer than one without the property (77/63 = 122%).  The overall preference
334 for each highway segment is the product of the preference for the highway type
335 and all of the preferences for the highway properties.
336
337 <p>
338 Example usage (motorbike journey, scenic route, not very fast):
339
340 <pre class="boxed">
341 ./router --dir=data --prefix=gb --transport=motorbike --highway-motorway=0 \
342          --highway-trunk=0 --speed-primary=80 --speed-secondary=80 --quickest
343 </pre>
344
345 This will use the files 'data/gb-nodes.mem', 'data/gb-segments.mem' and
346 'data/gb-ways.mem' to find the quickest route by motorbike not using motorways
347 or trunk roads and not exceeding 80 km/hr.
348
349
350 <h3><a name="H_1_1_3"></a>filedumper</h3>
351
352 This program is used to extract statistics from the database, extract particular
353 information for visualisation purposes or for dumping the database contents.
354
355 <pre class="boxed">
356 Usage: filedumper [--help]
357                   [--dir=&lt;dirname&gt;] [--prefix=&lt;name&gt;]
358                   [--statistics]
359                   [--visualiser --latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
360                                 --lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;
361                                 --data=&lt;data-type&gt;]
362                   [--dump [--node=&lt;node&gt; ...]
363                           [--segment=&lt;segment&gt; ...]
364                           [--way=&lt;way&gt; ...]]
365                   [--dump-osm [--no-super]
366                               [--latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
367                                --lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;]]
368 </pre>
369
370 <dl>
371   <dt>--help
372   <dd>Prints out the help information.
373   <dt>--dir=&lt;dirname&gt;
374   <dd>Sets the directory name in which to read the local database.
375     Defaults to the current directory.
376   <dt>--prefix=&lt;name&gt;
377   <dd>Sets the filename prefix for the files in the local database.
378   <dt>--statistics
379   <dd>Prints out statistics about the database files.
380   <dt>--visualiser
381   <dd>Selects a data visualiser mode which will output a set of data according
382     to the other parameters below.
383     <dl>
384       <dt>--latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
385       <dd>The range of latitudes to print the data for.
386       <dt>--lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;
387       <dd>The range of longitudes to print the data for.
388       <dt>--data=&lt;data-type&gt;
389       <dd>The type of data to output, &lt;data-type&gt; can be selected from:
390         <ul>
391           <li>junctions = segment count at each junction.
392           <li>super     = super-node and super-segments.
393           <li>oneway    = oneway segments.
394           <li>speed     = speed limits.
395           <li>weight    = weight limits.
396           <li>height    = height limits.
397           <li>width     = width limits.
398           <li>length    = length limits.
399         </ul>
400     </dl>
401   <dt>--dump
402   <dd>Selects a data dumping mode which allows looking at individual items in
403     the databases (specifying 'all' instead of a number dumps all of them).
404     <dl>
405       <dt>--node=&lt;node&gt;
406       <dd>Prints the information about the selected node number (internal
407         number, not the node id number in the original source file).
408       <dt>--segment=&lt;segment&gt;
409       <dd>Prints the information about the selected segment number.
410       <dt>--way=&lt;way&gt;
411       <dd>Prints the information about the selected way number (internal
412         number, not the way id number in the original source file).
413     </dl>
414   <dt>--osm-dump
415   <dd>Dumps the contents of the database as an OSM format XML file, the whole
416     database will be dumped unless the latitude and longitude ranges are
417     specified.
418     <dl>
419       <dt>--no-super
420       <dd>The super segments will not be output.
421       <dt>--latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
422       <dd>The range of latitudes to dump the data for.
423       <dt>--lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;
424       <dd>The range of longitudes to dump the data for.
425     </dl>
426 </dl>
427
428 <p>
429 <i>Note: In version 1.5 of Routino a slim option has been added and at
430 compilation time a separate program called <em>filedumper-slim</em> is created
431 that operates in slim mode.  In slim mode the database files are read as needed
432 rather than being mapped into memory.</i>
433
434
435 <h3><a name="H_1_1_4"></a>tagmodifier</h3>
436
437 This program is used to run the tag transformation process on an OSM XML file
438 for test purposes.
439
440 <pre class="boxed">
441 Usage: tagmodifier [--help]
442                    [--loggable]
443                    [--tagging=&lt;filename&gt;]
444                    [&lt;filename.osm&gt;]
445 </pre>
446
447 <dl>
448   <dt>--help
449   <dd>Prints out the help information.
450   <dt>--loggable
451   <dd>Print progress messages that are suitable for logging to a file; normally
452     an incrementing counter is printed which is more suitable for realtime
453     display than logging.
454   <dt>--tagging=&lt;filename&gt;
455   <dd>The name of the XML file containing the tagging rules (defaults to
456     'tagging.xml' in the current directory).
457   <dt>&lt;filename.osm&gt; ...
458   <dd>Specifies the filename to read data from, by default data is read from
459     the standard input.
460 </dl>
461
462 </div>
463
464 <!-- Content End -->
465
466 <!-- Footer Start -->
467
468 <div class="footer" align="center">
469 <hr>
470
471 <address>
472 &copy; Andrew M. Bishop = &lt;amb "at" gedanken.demon.co.uk&gt;
473 </address>
474
475 </div>
476
477 <!-- Footer End -->
478
479 </BODY>
480
481 </HTML>