Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/doc/html/usage.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1120 - (show annotations) (download) (as text)
Thu Nov 1 20:00:27 2012 UTC (12 years, 4 months ago) by amb
File MIME type: text/html
File size: 23560 byte(s)
Introduce a new'--append' option for appending data from a file to the currently
parsed data.  Rename the intermediate file used for storing data to be appended
to.  Add a function to call after appending to a file which closes the file and
renames it to a temporary filename which is used for the remaining processing.

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-2012 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;] [--sort-threads=&lt;number&gt;]
66 [--tmpdir=&lt;dirname&gt;]
67 [--tagging=&lt;filename&gt;]
68 [--loggable] [--logtime]
69 [--errorlog[=&lt;name&gt;]]
70 [--parse-only | --process-only]
71 [--append]
72 [--max-iterations=&lt;number&gt;]
73 [--prune-none]
74 [--prune-isolated=&lt;len&gt;]
75 [--prune-short=&lt;len&gt;]
76 [--prune-straight=&lt;len&gt;]
77 [&lt;filename.osm&gt; ...]
78 </pre>
79
80 <dl>
81 <dt>--help
82 <dd>Prints out the help information.
83 <dt>--dir=&lt;dirname&gt;
84 <dd>Sets the directory name in which to save the results.
85 Defaults to the current directory.
86 <dt>--prefix=&lt;name&gt;
87 <dd>Sets the filename prefix for the files that are created.
88 Defaults to no prefix.
89 <dt>--sort-ram-size=&lt;size&gt;
90 <dd>Specifies the amount of RAM (in MB) to use for sorting the data. If not
91 specified then 64 MB will be used in slim mode or 256 MB otherwise.
92 <dt>--sort-threads=&lt;number&gt;
93 <dd>The number of threads to use for data sorting (the sorting memory is
94 shared between the threads - too many threads and not enough memory will
95 reduce the performance).
96 <dt>--tmpdir=&lt;dirname&gt;
97 <dd>Specifies the name of the directory to store the temporary disk files. If
98 not specified then it defaults to either the value of the --dir option or the
99 current directory.
100 <dt>--tagging=&lt;filename&gt;
101 <dd>Sets the filename containing the list of tagging rules in XML format for
102 the parsing the input files. If the file doesn't exist then dirname, prefix
103 and "profiles.xml" will be combined and used, if that doesn't exist then the
104 file '/usr/local/share/routino/profiles.xml' (or custom installation
105 location) will be used.
106 <dt>--loggable
107 <dd>Print progress messages that are suitable for logging to a file; normally
108 an incrementing counter is printed which is more suitable for real-time
109 display than logging.
110 <dt>--logtime
111 <dd>Print the elapsed time for each processing step.
112 <dt>--errorlog[=&lt;name&gt;]
113 <dd>Log OSM parsing and processing errors to 'error.log' or the specified file
114 name (the '--dir' and '--prefix' options are applied). If the --append
115 option is used then the existing log file will be appended, otherwise a new
116 one will be created.
117 <dt>--parse-only
118 <dd>Parse the input files and store the data in intermediate files but don't
119 process the data into a routing database. This option must be used with the
120 --append option for all except the first file.
121 <dt>--process-only
122 <dd>Don't read in any files but process the existing intermediate files
123 created by using the --parse-only option.
124 <dt>--append
125 <dd>Parse the input file and append the result to the existing intermediate
126 files.
127 <dt>--max-iterations=&lt;number&gt;
128 <dd>The maximum number of iterations to use when generating super-nodes and
129 super-segments. Defaults to 5 which is normally enough.
130 <dt>--prune-none
131 <dd>Disable the prune options below, they can be re-enabled by adding them to
132 the command line after this option.
133 <dt>--prune-isolated=&lt;length&gt;
134 <dd>Remove the access permissions for a transport type from small disconnected
135 groups of segments and remove the segments if they nd up with no access
136 permission (defaults to removing groups under 500m).
137 <dt>--prune-short=&lt;length&gt;
138 <dd>Remove short segments (defaults to removing segments up to a maximum
139 length of 5m).
140 <dt>--prune-straight=&lt;length&gt;
141 <dd>Remove nodes in almost straight highways (defaults to removing nodes up to
142 3m offset from a straight line).
143 <dt>&lt;filename.osm&gt; ...
144 <dd>Specifies the filename(s) to read data from, by default data is read from
145 the standard input.
146 </dl>
147
148 <p>
149 <i>Note: In version 1.4 of Routino the --transport, --not-highway and
150 --not-property options have been removed. The same functionality can be
151 achieved by editing the tagging rules file to not output unwanted data.</i>
152
153 <p>
154 <i>Note: In version 1.5 of Routino the --slim option has been removed but at
155 compilation time a separate program called <em>planetsplitter-slim</em> is
156 created that operates in slim mode. In slim mode the temporary files and
157 database files are read as needed rather than being mapped into memory. This
158 allows a database size greater than 2 GB on 32-bit machines or usage with little
159 or no virtual memory (e.g. some virtual machines). The penalty for this is that
160 the program takes about twice as long to run.</i>
161
162 <p>
163 Example usage 1:
164
165 <pre class="boxed">
166 planetsplitter --dir=data --prefix=gb great_britain.osm
167 </pre>
168
169 This will generate the output files 'data/gb-nodes.mem', 'data/gb-segments.mem'
170 and 'data/gb-ways.mem'. Multiple filenames can be specified on the command
171 line and they will all be read in, combined and processed together.
172
173 <p>
174 Example usage 2:
175
176 <pre class="boxed">
177 planetsplitter --dir=data --prefix=gb --parse-only great_britain_part1.osm
178 planetsplitter --dir=data --prefix=gb --parse-only --append great_britain_part2.osm
179 planetsplitter --dir=data --prefix=gb --parse-only --append ...
180 planetsplitter --dir=data --prefix=gb --process-only
181 </pre>
182
183 This will generate the same output files as the first example but parsing the
184 input files is performed separately from the data processing. The first file
185 read in must not use the --append option but the later ones must.
186
187
188 <h3><a name="H_1_1_2"></a>router</h3>
189
190 This program performs the calculation of the optimum routes using the database
191 generated by the planetsplitter program.
192
193 <pre class="boxed">
194 Usage: router [--help | --help-profile | --help-profile-xml |
195 --help-profile-json | --help-profile-perl ]
196 [--dir=&lt;dirname&gt;] [--prefix=&lt;name&gt;]
197 [--profiles=&lt;filename&gt;] [--translations=&lt;filename&gt;]
198 [--exact-nodes-only]
199 [--loggable | --quiet]
200 [--output-html]
201 [--output-gpx-track] [--output-gpx-route]
202 [--output-text] [--output-text-all]
203 [--output-none]
204 [--profile=&lt;name&gt;]
205 [--transport=&lt;transport&gt;]
206 [--shortest | --quickest]
207 --lon1=&lt;longitude&gt; --lat1=&lt;latitude&gt;
208 --lon2=&lt;longitude&gt; --lon2=&lt;latitude&gt;
209 [ ... --lon99=&lt;longitude&gt; --lon99=&lt;latitude&gt;]
210 [--heading=&lt;bearing&gt;]
211 [--highway-&lt;highway&gt;=&lt;preference&gt; ...]
212 [--speed-&lt;highway&gt;=&lt;speed&gt; ...]
213 [--property-&lt;property&gt;=&lt;preference&gt; ...]
214 [--oneway=(0|1)] [--turns=(0|1)]
215 [--weight=&lt;weight&gt;]
216 [--height=&lt;height&gt;] [--width=&lt;width&gt;] [--length=&lt;length&gt;]
217 </pre>
218
219 <dl>
220 <dt>--help
221 <dd>Prints out the help information.
222 <dt>--help-profile
223 <dd>Prints out the selected transport profile (type, speed limits, highway
224 preferences etc.)
225 <dt>--help-profile-xml
226 <dd>Prints out all the loaded profiles as an XML file in the same format that
227 can be loaded in.
228 <dt>--help-profile-json
229 <dd>Prints out all the loaded profiles in JavaScript Object Notation (JSON)
230 format for use in the interactive webpage.
231 <dt>--help-profile-perl
232 <dd>Prints out all the loaded profiles as a Perl object for use in the router
233 CGI.
234 <dt>--dir=&lt;dirname&gt;
235 <dd>Sets the directory name in which to read the local database.
236 Defaults to the current directory.
237 <dt>--prefix=&lt;name&gt;
238 <dd>Sets the filename prefix for the files in the local database.
239 Defaults to no prefix.
240 <dt>--profiles=&lt;filename&gt;
241 <dd>Sets the filename containing the list of routing profiles in XML format.
242 If the file doesn't exist then dirname, prefix and "profiles.xml" will be
243 combined and used, if that doesn't exist then the file
244 '/usr/local/share/routino/profiles.xml' (or custom installation location)
245 will be used.
246 <dt>--translations=&lt;filename&gt;
247 <dd>Sets the filename containing the list of translations in XML format for
248 the output files. If the file doesn't exist then dirname, prefix and
249 "translations.xml" will be combined and used, if that doesn't exist then the
250 file '/usr/local/share/routino/translations.xml' (or custom installation
251 location) will be used.
252 <dt>--exact-nodes-only
253 <dd>When processing the specified latitude and longitude points only select
254 the nearest node instead of finding the nearest point within a segment
255 (quicker but less accurate unless the points are already near nodes).
256 <dt>--loggable
257 <dd>Print progress messages that are suitable for logging to a file; normally
258 an incrementing counter is printed which is more suitable for real-time
259 display than logging.
260 <dt>--quiet
261 <dd>Don't generate any screen output while running (useful for running in a script).
262 <dt>--language=&lt;lang&gt;
263 <dd>Select the language specified from the file of translations. If this
264 option is not given and the file exists then the first language in the file
265 will be used. If this option is not given and no file exists the
266 compiled-in default language (English) will be used.
267 <dt>--output-html
268 <dt>--output-gpx-track
269 <dt>--output-gpx-route
270 <dt>--output-text
271 <dt>--output-text-all
272 <dd>Generate the selected output file formats (HTML, GPX track file, GPX route
273 file, plain text route and/or plain text with all nodes). If no output is
274 specified then all are generated, specifying any automatically disables those
275 not specified.
276 <dt>--output-none
277 <dd>Do not generate any output or read in any translations files.
278 <dt>--profile=&lt;name&gt;
279 <dd>Specifies the name of the profile to use.
280 <dt>--transport=&lt;transport&gt;
281 <dd>Select the type of transport to use, &lt;transport&gt; can be set to:
282 <ul>
283 <li>foot = Foot
284 <li>horse = Horse
285 <li>wheelchair = Wheelchair
286 <li>bicycle = Bicycle
287 <li>moped = Moped (Small motorbike, limited speed)
288 <li>motorbike = Motorbike
289 <li>motorcar = Motorcar
290 <li>goods = Goods (Small lorry, van)
291 <li>hgv = HGV (Heavy Goods Vehicle - large lorry)
292 <li>psv = PSV (Public Service Vehicle - bus, coach)
293 </ul>
294 Defaults to 'motorcar', this option also selects the default profile
295 information if the '--profile' option is not given and a profile matching
296 the transport name is found.
297 <dt>--shortest
298 <dd>Find the shortest route between the waypoints.
299 <dt>--quickest
300 <dd>Find the quickest route between the waypoints.
301 <dt>--lon1=&lt;longitude&gt;, --lat1=&lt;latitude&gt;
302 <dt>--lon2=&lt;longitude&gt;, --lat2=&lt;latitude&gt;
303 <dt>... --lon99=&lt;longitude&gt;, --lat99=&lt;latitude&gt;
304 <dd>The location of the waypoints that make up the start, middle and end
305 points of the route. Up to 99 waypoints can be specified and the route will
306 pass through each of the specified ones in sequence. The algorithm will use
307 the closest node or point within a segment that allows the specified traffic
308 type.
309 <dt>--heading=&lt;bearing&gt;
310 <dd>Specifies the initial direction of travel at the start of the route (from
311 the lowest numbered waypoint) as a compass bearing from 0 to 360 degrees.
312 <dt>--highway-&lt;highway&gt;=&lt;preference&gt;
313 <dd>Selects the percentage preference for using each particular type of
314 highway. The value of &lt;highway&gt; can be selected from:
315 <ul>
316 <li>motorway = Motorway
317 <li>trunk = Trunk
318 <li>primary = Primary
319 <li>secondary = Secondary
320 <li>tertiary = Tertiary
321 <li>unclassified = Unclassified
322 <li>residential = Residential
323 <li>service = Service
324 <li>track = Track
325 <li>cycleway = Cycleway
326 <li>path = Path
327 <li>steps = Steps
328 <li>ferry = Ferry
329 </ul>
330 Default value depends on the profile selected by the --transport option.
331 <dt>--speed-&lt;highway&gt;=&lt;speed&gt;
332 <dd>Selects the speed limit in km/hour for each type of highway. Default
333 value depends on the profile selected by the --transport option.
334 <dt>--property-&lt;property&gt;=&lt;preference&gt;
335 <dd>Selects the percentage preference for using each particular highway
336 property
337 The value of &lt;property&gt; can be selected from:
338 <ul>
339 <li>paved = Paved (suitable for normal wheels)
340 <li>multilane = Multiple lanes
341 <li>bridge = Bridge
342 <li>tunnel = Tunnel
343 <li>footroute = A route marked for foot travel
344 <li>bicycleroute = A route marked for bicycle travel
345 </ul>
346 Default value depends on the profile selected by the --transport option.
347 <dt>--oneway=[0|1]
348 <dd>Selects if the direction of oneway streets are to be obeyed (useful to not
349 obey them when walking). Default value depends on the profile selected by
350 the --transport option.
351 <dt>--turns=[0|1]
352 <dd>Selects if turn restrictions are to be obeyed (useful to not obey them
353 when walking). Default value depends on the profile selected by the
354 --transport option.
355 <dt>--weight=&lt;weight&gt;
356 <dd>Specifies the weight of the mode of transport in tonnes; ensures that the
357 weight limit on the highway is not exceeded. Default value depends on the
358 profile selected by the --transport option.
359 <dt>--height=&lt;height&gt;
360 <dd>Specifies the height of the mode of transport in metres; ensures that the
361 height limit on the highway is not exceeded. Default value depends on the
362 profile selected by the --transport option.
363 <dt>--width=&lt;width&gt;
364 <dd>Specifies the width of the mode of transport in metres; ensures that the
365 width limit on the highway is not exceeded. Default value depends on the
366 profile selected by the --transport option.
367 <dt>--length=&lt;length&gt;
368 <dd>Specifies the length of the mode of transport in metres; ensures that the
369 length limit on the highway is not exceeded. Default value depends on the
370 profile selected by the --transport option.
371 </dl>
372
373 <p>
374 <i>Note: In version 1.5 of Routino a slim option has been added and at
375 compilation time a separate program called <em>router-slim</em> is created that
376 operates in slim mode. In slim mode the database files are read as needed
377 rather than being mapped into memory.</i>
378
379 <p>
380 The meaning of the &lt;preference&gt; parameter in the command line options is
381 slightly different for the highway preferences and the property preferences.
382 For the highway preference consider the choice between two possible highways
383 between the start and finish when looking for the shortest route. If highway A
384 has a preference of 100% and highway B has a preference of 90% then highway A
385 will be chosen even if it is up to 11% longer (100/90 = 111%). For the highway
386 properties each highway either has a particular property or not. If the
387 preference for the property is 60% then a highway with the property has a
388 preference of 77% (sqrt(60%)) and one without has a preference of 63%
389 (sqrt(100-60%)). A highway with the property will be chosen even if it is up to
390 22% longer than one without the property (77/63 = 122%). The overall preference
391 for each highway segment is the product of the preference for the highway type
392 and all of the preferences for the highway properties.
393
394 <p>
395 Example usage (motorbike journey, scenic route, not very fast):
396
397 <pre class="boxed">
398 router --dir=data --prefix=gb --transport=motorbike --highway-motorway=0 \
399 --highway-trunk=0 --speed-primary=80 --speed-secondary=80 --quickest
400 </pre>
401
402 This will use the files 'data/gb-nodes.mem', 'data/gb-segments.mem' and
403 'data/gb-ways.mem' to find the quickest route by motorbike not using motorways
404 or trunk roads and not exceeding 80 km/hr.
405
406
407 <h3><a name="H_1_1_3"></a>filedumper</h3>
408
409 This program is used to extract statistics from the database, extract particular
410 information for visualisation purposes or for dumping the database contents.
411
412 <pre class="boxed">
413 Usage: filedumper [--help]
414 [--dir=&lt;dirname&gt;] [--prefix=&lt;name&gt;]
415 [--statistics]
416 [--visualiser --latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
417 --lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;
418 --data=&lt;data-type&gt;]
419 [--dump [--node=&lt;node&gt; ...]
420 [--segment=&lt;segment&gt; ...]
421 [--way=&lt;way&gt; ...]
422 [--turn-relation=&lt;relation&gt; ...]]
423 [--dump-osm [--no-super]
424 [--latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
425 --lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;]]
426 </pre>
427
428 <dl>
429 <dt>--help
430 <dd>Prints out the help information.
431 <dt>--dir=&lt;dirname&gt;
432 <dd>Sets the directory name in which to read the local database.
433 Defaults to the current directory.
434 <dt>--prefix=&lt;name&gt;
435 <dd>Sets the filename prefix for the files in the local database.
436 <dt>--statistics
437 <dd>Prints out statistics about the database files.
438 <dt>--visualiser
439 <dd>Selects a data visualiser mode which will output a set of data according
440 to the other parameters below.
441 <dl>
442 <dt>--latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
443 <dd>The range of latitudes to print the data for.
444 <dt>--lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;
445 <dd>The range of longitudes to print the data for.
446 <dt>--data=&lt;data-type&gt;
447 <dd>The type of data to output, &lt;data-type&gt; can be selected from:
448 <ul>
449 <li>junctions = segment count at each junction.
450 <li>super = super-node and super-segments.
451 <li>oneway = oneway segments.
452 <li>highway-* = segments of the specified highway type
453 (e.g. highway-primary to display segments ofprimary roads).
454 <li>transport-* = segments allowing the specified transport type
455 (e.g. transport-foot to display segments accessible on foot).
456 <li>turns = turn restrictions.
457 <li>speed = speed limits.
458 <li>weight = weight limits.
459 <li>height = height limits.
460 <li>width = width limits.
461 <li>length = length limits.
462 </ul>
463 </dl>
464 <dt>--dump
465 <dd>Selects a data dumping mode which allows looking at individual items in
466 the databases (specifying 'all' instead of a number dumps all of them).
467 More than one of the following parameters can be specified on the command
468 line.
469 <dl>
470 <dt>--node=&lt;node&gt;
471 <dd>Prints the information about the selected node number (internal
472 number, not the node id number in the original source file).
473 <dt>--segment=&lt;segment&gt;
474 <dd>Prints the information about the selected segment number.
475 <dt>--way=&lt;way&gt;
476 <dd>Prints the information about the selected way number (internal
477 number, not the way id number in the original source file).
478 <dt>--turn-relation=&lt;relation&gt;
479 <dd>Prints the information about the selected turn relation number
480 (internal number, not the relation id number in the original source
481 file).
482 </dl>
483 <dt>--osm-dump
484 <dd>Dumps the contents of the database as an OSM format XML file, the whole
485 database will be dumped unless the latitude and longitude ranges are
486 specified.
487 <dl>
488 <dt>--no-super
489 <dd>The super segments will not be output.
490 <dt>--latmin=&lt;latmin&gt; --latmax=&lt;latmax&gt;
491 <dd>The range of latitudes to dump the data for.
492 <dt>--lonmin=&lt;lonmin&gt; --lonmax=&lt;lonmax&gt;
493 <dd>The range of longitudes to dump the data for.
494 </dl>
495 </dl>
496
497 <p>
498 <i>Note: In version 1.5 of Routino a slim option has been added and at
499 compilation time a separate program called <em>filedumper-slim</em> is created
500 that operates in slim mode. In slim mode the database files are read as needed
501 rather than being mapped into memory.</i>
502
503
504 <h3><a name="H_1_1_4"></a>tagmodifier</h3>
505
506 This program is used to run the tag transformation process on an OSM XML file
507 for test purposes.
508
509 <pre class="boxed">
510 Usage: tagmodifier [--help]
511 [--loggable]
512 [--tagging=&lt;filename&gt;]
513 [&lt;filename.osm&gt;]
514 </pre>
515
516 <dl>
517 <dt>--help
518 <dd>Prints out the help information.
519 <dt>--loggable
520 <dd>Print progress messages that are suitable for logging to a file; normally
521 an incrementing counter is printed which is more suitable for real-time
522 display than logging.
523 <dt>--tagging=&lt;filename&gt;
524 <dd>The name of the XML file containing the tagging rules (defaults to
525 'tagging.xml' in the current directory).
526 <dt>&lt;filename.osm&gt; ...
527 <dd>Specifies the filename to read data from, by default data is read from
528 the standard input.
529 </dl>
530
531 </div>
532
533 <!-- Content End -->
534
535 <!-- Footer Start -->
536
537 <div class="footer" align="center">
538 <hr>
539
540 <address>
541 &copy; Andrew M. Bishop = &lt;amb "at" gedanken.demon.co.uk&gt;
542 </address>
543
544 </div>
545
546 <!-- Footer End -->
547
548 </BODY>
549
550 </HTML>