5af6812be4abdf32469f10384b896030c4755734
[routino] / doc / html / tagging.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 - tagging
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 : Tagging Rules</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 : Tagging Rules</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>Tags And Attributes</h2>
49
50 The different tags and attributes in the 
51 <a class="ext" title="OpenStreetMap" href="http://www.openstreetmap.org/">OSM</a>
52 format XML that are used by Routino are described below.
53
54 <p>
55
56 An important change for version 1.4 of Routino is that the tags in the input
57 file are first processed according to a set of rules defined in a configuration
58 file.  This means that the information presented here is in two parts; firstly
59 the tags that are recognised by Routino after pre-processing and secondly the
60 transformations in the default configuration file.
61
62
63 <h2><a name="H_1_2" title="After Processing"></a>Tags Recognised After Processing</h2>
64
65 This section describes the tags that are recognised by Routino after the tag
66 transformations have been applied.  This is therefore a much reduced set of tags
67 compared to the original OSM data and also includes tags which are specific to
68 Routino.
69
70 <p>
71
72 In all cases of tag processing values of <em>true</em>, <em>yes</em>, <em>1</em>
73 are recognised as being affirmative and any other value is ignored.
74
75
76 <h3><a name="H_1_2_1" title="Nodes"></a>Node Tags And Attributes</h3>
77
78 None of the node tags are used but the node attributes <em>id</em>, <em>latitude</em>
79 and <em>longitude</em> of the node.  The id atribute is required to associate the
80 node with the ways and the position attributes are required to locate the node.
81
82
83 <h3><a name="H_1_2_2" title="Ways"></a>Way Tags And Attributes</h3>
84
85 The tags from the ways in the data are the ones that provide most of the
86 information for routing.  The <em>id</em> attribute is used only so that the
87 many segments associated with a way can be share a set of tags taken from the
88 way.
89
90
91 <h4><a name="H_1_2_2_1" title="highway"></a>The highway Tag</h4>
92
93 The most important tag that is used from a way is the <em>highway</em> tag.
94 This defines the type of highway that the way represents.  Any way that does not
95 have a highway tag is discarded.
96
97 <p>
98
99 There are more highway types defined than are used by the router.  The subset
100 that the router uses are:
101
102 <ul>
103   <li>motorway
104   <li>trunk
105   <li>primary
106   <li>secondary
107   <li>tertiary
108   <li>unclassified
109   <li>residential
110   <li>service
111   <li>track
112   <li>cycleway
113   <li>path (1)
114   <li>steps (2)
115 </ul>
116
117 <p>
118
119 <i>
120   Note 1: This changed in version 1.3 of Routino - the bridleway and footway
121   types were included within the path highway type.
122   <br>
123   Note 2: This changed in version 1.3 of Routino - the steps type was separated
124   from the footway type.
125 </i>
126
127
128 <h4><a name="H_1_2_2_2" title="transport tags"></a>Transport Specific Tags</h4>
129
130 One tag is recognised for each of the different modes of transport: <em>foot</em>,
131 <em>horse</em>, <em>bicycle</em>, <em>wheelchair</em>, <em>moped</em>,
132 <em>motorbike</em>, <em>motorcar</em>, <em>goods</em>, <em>hgv</em>
133 and <em>psv</em>.  These indicate whether the specific type of transport is
134 allowed on the highway or not.
135
136
137 <h4><a name="H_1_2_2_3" title="name"></a>The name Tag</h4>
138
139 The <em>name</em> tag is used to provide the label for the highway when printing
140 the results.
141
142
143 <h4><a name="H_1_2_2_4" title="ref"></a>The ref Tag</h4>
144
145 The <em>ref</em> tag is used to provide the label for the highway when printing
146 the results.
147
148
149 <h4><a name="H_1_2_2_5" title="junction"></a>The junction Tag</h4>
150
151 The <em>junction</em> tag is used to check if a highway is (part of) a
152 roundabout.  This tag is used for information to label the highway if no other
153 name is provided.
154
155
156 <h4><a name="H_1_2_2_6" title="multilane"></a>The multilane Tag</h4>
157
158 The <em>multilane</em> tag is used to identify whether a highway has multiple
159 lanes for traffic and this sets one of the highway properties.  There is not
160 normally a <em>multilane</em> tag but one needs to be added by the tag
161 processing transformations.  Values of <em>true</em>, <em>yes</em>, <em>1</em>
162 are recognised.
163
164
165 <h4><a name="H_1_2_2_7" title="paved"></a>The paved Tag</h4>
166
167 The <em>paved</em> tag is used to identify whether a highway is paved or not,
168 this is one of the available highway properties.  A <em>paved</em> tag may exist
169 in the original data but normally the <em>surface</em> tag needs to be
170 transformed into the paved tag.
171
172
173 <h4><a name="H_1_2_2_8" title="bridge"></a>The bridge Tag</h4>
174
175 The <em>bridge</em> tag is used to identify whether a highway is a bridge and
176 therefore set one of the available properties.
177
178
179 <h4><a name="H_1_2_2_9" title="tunnel"></a>The tunnel Tag</h4>
180
181 The <em>tunnel</em> tag is used to identify whether a highway is a tunnel and
182 therefore set one of the available properties.
183
184
185 <h4><a name="H_1_2_2_10" title="oneway"></a>The oneway Tag</h4>
186
187 The <em>oneway</em> tag is used to specify that traffic is only allowed to
188 travel in one direction.
189
190
191 <h4><a name="H_1_2_2_11" title="maxspeed"></a>The maxspeed Tag</h4>
192
193 The <em>maxspeed</em> tag is used to specify the maximum speed limit on the
194 highway; this is always measured in km/hr in OpenStreetMap data.  If the tag
195 value contains "mph" then it is assumed to be a value in those units and
196 converted to km/hr.
197
198
199 <h4><a name="H_1_2_2_12" title="maxweight"></a>The maxweight Tag</h4>
200
201 The <em>maxweight</em> tag is used to specify the maximum weight of any traffic
202 on the way.  In other words this must be set to the heaviest weight allowed on
203 the way (for example a bridge) in tonnes.  If the tag value contains "kg" then
204 it is assumed that the value is in these units and converted to tonnes.
205
206
207 <h4><a name="H_1_2_2_13" title="maxheight"></a>The maxheight Tag</h4>
208
209 The <em>maxheight</em> tag is used to specify the maximum height of any traffic
210 on the way.  In other words this must be set to the lowest height of anything
211 above the way (like a bridge) in metres.  If the tag value contains a
212 measurement in feet or feet and inches then attempts are made to convert this to
213 metres.
214
215
216 <h4><a name="H_1_2_2_14" title="maxwidth"></a>The maxwidth Tag</h4>
217
218 The <em>maxwidth</em> tag is used to specify the maximum width of any traffic on
219 the way.  This must be set to the minimum width of the contraints at the wayside
220 in metres.  If the tag value contains a measurement in feet or feet and inches
221 then attempts are made to convert this to metres.
222
223
224 <h4><a name="H_1_2_2_15" title="maxlength"></a>The maxlength Tag</h4>
225
226 The <em>maxlength</em> tag is used to specify the maximum length of any traffic
227 on the way (usually from a traffic sign) in metres.  If the tag value contains a
228 measurement in feet or feet and inches then attempts are made to convert this to
229 metres.
230
231
232 <h3><a name="H_1_2_3" title="Relations"></a>Relation Tags And Attributes</h3>
233
234 Currently no relation tags or attributes are used.
235
236
237 <h2><a name="H_1_3" title="Tag Transformations"></a>Tag Transformations</h2>
238
239 This section describes the set of tag transformations that are contained in the
240 default configuration file.  The configuration file tagging rules are applied in
241 sequence and this section of the document is arranged in the same order.
242
243
244 <h3><a name="H_1_3_1" title="Nodes"></a>Node Tag Transformations</h3>
245
246 No transformations are applicable since no node tags are recognised.
247
248
249 <h3><a name="H_1_3_2" title="Ways"></a>Way Tag Transformations</h3>
250
251
252 <h4><a name="H_1_3_2_1" title="Highway Defaults"></a>Highway Defaults</h4>
253
254 The first part of the tag transformations is to decide on defaults for each type
255 of highway.  This uses the highway tag in the OSM file and maps it into one of
256 the highway tags that are recognised by Routino, defining the default allowed
257 transport types and adding a number of properties.
258
259 <p>
260
261 The first part of the transformation is to convert the highway tag into one that
262 is recognised by Routino.
263
264 <p>
265
266 <table>
267   <caption>Mapping of equivalent highway types</caption>
268   <tr>
269     <th class="left">Original tag
270     <th class="left">Transformed tag
271   <tr>
272     <td class="left">bridleway
273     <td class="left">path
274   <tr>
275     <td class="left">byway
276     <td class="left">track
277   <tr>
278     <td class="left">footway
279     <td class="left">path
280   <tr>
281     <td class="left">living_street
282     <td class="left">residential
283   <tr>
284     <td class="left">minor
285     <td class="left">unclassified
286   <tr>
287     <td class="left">pedestrian
288     <td class="left">path
289   <tr>
290     <td class="left">road
291     <td class="left">unclassified
292   <tr>
293     <td class="left">services
294     <td class="left">service
295   <tr>
296     <td class="left">unsurfaced
297     <td class="left">track
298   <tr>
299     <td class="left">unpaved
300     <td class="left">track
301   <tr>
302     <td class="left">walkway
303     <td class="left">path
304 </table>
305
306 <p>
307
308 The type of highway also determines the defaults for the types of transport
309 allowed on the highway.  The default assumptions are as shown in the table
310 below.
311
312 <p>
313
314 <table>
315   <caption>Transport types on different highway types</caption>
316   <tr>
317     <th class="left">Highway
318     <th class="center">foot
319     <th class="center">horse
320     <th class="center">bicycle
321     <th class="center">wheelchair
322     <th class="center">moped
323     <th class="center">motorbike
324     <th class="center">motorcar
325     <th class="center">goods
326     <th class="center">hgv
327     <th class="center">psv
328   <tr>
329     <td class="left">motorway
330     <td class="center">no
331     <td class="center">no
332     <td class="center">no
333     <td class="center">no
334     <td class="center">no
335     <td class="center">yes
336     <td class="center">yes
337     <td class="center">yes
338     <td class="center">yes
339     <td class="center">yes
340   <tr>
341     <td class="left">trunk
342     <td class="center">no
343     <td class="center">no
344     <td class="center">no
345     <td class="center">yes
346     <td class="center">yes
347     <td class="center">yes
348     <td class="center">yes
349     <td class="center">yes
350     <td class="center">yes
351     <td class="center">yes
352   <tr>
353     <td class="left">primary
354     <td class="center">yes
355     <td class="center">yes
356     <td class="center">yes
357     <td class="center">yes
358     <td class="center">yes
359     <td class="center">yes
360     <td class="center">yes
361     <td class="center">yes
362     <td class="center">yes
363     <td class="center">yes
364   <tr>
365     <td class="left">secondary
366     <td class="center">yes
367     <td class="center">yes
368     <td class="center">yes
369     <td class="center">yes
370     <td class="center">yes
371     <td class="center">yes
372     <td class="center">yes
373     <td class="center">yes
374     <td class="center">yes
375     <td class="center">yes
376   <tr>
377     <td class="left">tertiary
378     <td class="center">yes
379     <td class="center">yes
380     <td class="center">yes
381     <td class="center">yes
382     <td class="center">yes
383     <td class="center">yes
384     <td class="center">yes
385     <td class="center">yes
386     <td class="center">yes
387     <td class="center">yes
388   <tr>
389     <td class="left">unclassified
390     <td class="center">yes
391     <td class="center">yes
392     <td class="center">yes
393     <td class="center">yes
394     <td class="center">yes
395     <td class="center">yes
396     <td class="center">yes
397     <td class="center">yes
398     <td class="center">yes
399     <td class="center">yes
400   <tr>
401     <td class="left">residential
402     <td class="center">yes
403     <td class="center">yes
404     <td class="center">yes
405     <td class="center">yes
406     <td class="center">yes
407     <td class="center">yes
408     <td class="center">yes
409     <td class="center">yes
410     <td class="center">yes
411     <td class="center">yes
412   <tr>
413     <td class="left">service
414     <td class="center">yes
415     <td class="center">yes
416     <td class="center">yes
417     <td class="center">yes
418     <td class="center">yes
419     <td class="center">yes
420     <td class="center">yes
421     <td class="center">yes
422     <td class="center">yes
423     <td class="center">yes
424   <tr>
425     <td class="left">track
426     <td class="center">yes
427     <td class="center">yes
428     <td class="center">yes
429     <td class="center">yes
430     <td class="center">no
431     <td class="center">no
432     <td class="center">no
433     <td class="center">no
434     <td class="center">no
435     <td class="center">no
436   <tr>
437     <td class="left">cycleway
438     <td class="center">yes
439     <td class="center">no
440     <td class="center">yes
441     <td class="center">yes
442     <td class="center">no
443     <td class="center">no
444     <td class="center">no
445     <td class="center">no
446     <td class="center">no
447     <td class="center">no
448   <tr>
449     <td class="left">path
450     <td class="center">yes
451     <td class="center">yes (1)
452     <td class="center">yes
453     <td class="center">yes (1)
454     <td class="center">no
455     <td class="center">no
456     <td class="center">no
457     <td class="center">no
458     <td class="center">no
459     <td class="center">no
460   <tr>
461     <td class="left">steps
462     <td class="center">yes
463     <td class="center">no
464     <td class="center">no
465     <td class="center">no
466     <td class="center">no
467     <td class="center">no
468     <td class="center">no
469     <td class="center">no
470     <td class="center">no
471     <td class="center">no
472 </table>
473
474 <p>
475
476 <i>
477   Note 1: A path allows bicycle or horse access by default only if actually
478   labelled as a highway of type "bridleway" or certain values of
479   the <em>designation</em> tag (described below).
480 </i>
481
482 <p>
483
484 Finally for the highway tag a number of properties are added depending on the
485 highway type.
486
487 <p>
488
489 <table>
490   <caption>Properties on different highway types</caption>
491   <tr>
492     <th class="center">Highway
493     <th class="center">Properties
494   <tr>
495     <td class="center">motorway
496     <td class="center">paved, oneway, multilane
497   <tr>
498     <td class="center">trunk
499     <td class="center">paved
500   <tr>
501     <td class="center">primary
502     <td class="center">paved
503   <tr>
504     <td class="center">secondary
505     <td class="center">paved
506   <tr>
507     <td class="center">tertiary
508     <td class="center">paved
509   <tr>
510     <td class="center">unclassified
511     <td class="center">paved
512   <tr>
513     <td class="center">residential
514     <td class="center">paved
515   <tr>
516     <td class="center">service
517     <td class="center">paved
518   <tr>
519     <td class="center">track
520     <td class="center">paved (1)
521   <tr>
522     <td class="center">cycleway
523     <td class="center">paved
524   <tr>
525     <td class="center">path
526     <td class="center">paved (2)
527   <tr>
528     <td class="center">steps
529     <td class="center">
530 </table>
531
532 <p>
533
534 <i>
535   Note 1: A track is paved only if it is tagged as tracktype=grade1.
536   <br>
537   Note 2: A path is paved only if it was originally tagged as highway=walkway or
538   highway=pedestrian.
539 </i>
540
541
542 <h4><a name="H_1_3_2_2" title="Generic access"></a>Generic Access Permissions</h4>
543
544 The <em>access</em> tag is used to specify the default access restrictions on
545 the way.  If the tag value is "no" or "private" then all transport types are
546 denied access (later tag transformation rules may add specific transport types
547 back again).
548
549
550 <h4><a name="H_1_3_2_3" title="Other access"></a>Other Access Permissions</h4>
551
552 A tag named <em>vehicle</em> means any of the <em>bicycle</em>, <em>moped</em>,
553 <em>motorbike</em>, <em>motorcar</em>, <em>goods</em>, <em>hgv</em>
554 and <em>psv</em> transport types.  A tag named <em>motor_vehicle</em> is
555 transformed to mean any vehicle except a <em>bicycle</em>.
556
557 <p>
558
559 The <em>designation</em> tag is used as an alternative method of identifying the
560 legal right of way on a path (in the UK at least).  The tag transformations
561 convert these tags into a set of allowed transport types as shown below.
562
563 <p>
564
565 <table>
566   <caption>Aliasing of designation types</caption>
567   <tr>
568     <th class="left">Designation tag
569     <th class="left">Equivalent access permissions
570   <tr>
571     <td class="left">bridleway or public_bridleway
572     <td class="left">foot=yes, wheelchair=yes, horse=yes, bicycle=yes
573   <tr>
574     <td class="left">restricted_byway
575     <td class="left">foot=yes, wheelchair=yes, horse=yes, bicycle=yes
576   <tr>
577     <td class="left">byway
578     <td class="left">foot=yes, wheelchair=yes, horse=yes, bicycle=yes, moped=yes, motorbike=yes, motorcar=yes
579   <tr>
580     <td class="left">footpath or public_footpath
581     <td class="left">foot=yes, wheelchair=yes
582 </table>
583
584
585 <h4><a name="H_1_3_2_4" title="Specific access"></a>Specific Access Permissions</h4>
586
587 The final part of the access permissions is to use the specific transport type
588 tags.
589
590 <p>
591
592 One tag is recognised for each of the different modes of transport: <em>foot</em>,
593 <em>horse</em>, <em>bicycle</em>, <em>wheelchair</em>, <em>moped</em>,
594 <em>motorbike</em>, <em>motorcar</em>, <em>goods</em>, <em>hgv</em>
595 and <em>psv</em>.  These indicate whether the specific type of transport is
596 allowed on the highway or not.
597
598
599 <h4><a name="H_1_3_2_5" title="Properties"></a>Highway Properties</h4>
600
601 If there is a surface tag then the highway is assumed to be unpaved unless the
602 tag value matches one of the following: <em>paved</em>, <em>asphalt</em>
603 or <em>concrete</em>.
604
605 <p>
606
607 Support for the obsolete <em>paved</em> tag is also provided and the highway is
608 paved if this is set to a true value.
609
610 <p>
611
612 The <em>lanes</em> tag is used to identify whether a highway has multiple lanes
613 for traffic or not (the number of lanes is not important in this case, only
614 whether it is more than one) this sets one of the highway properties.
615
616 <p>
617
618 The <em>bridge</em> and <em>tunnel</em> tags are copied directly from the input
619 to the output.
620
621
622 <h4><a name="H_1_3_2_6" title="Restrictions"></a>Highway Restrictions</h4>
623
624 The <em>oneway</em>, <em>maxspeed</em>, <em>maxweight</em>, <em>maxheight</em>,
625 <em>maxwidth</em> and <em>maxlength</em> are copied directly from the input to
626 the output without modification.
627
628
629 <h4><a name="H_1_3_2_7" title="Names and Refs"></a>Highway Names and References</h4>
630
631 The <em>name</em> and <em>ref</em> tags are copied directly from the input to
632 the output.
633
634
635 <h3><a name="H_1_3_3" title="Relations"></a>Relation Tag Transformations</h3>
636
637 No transformations are applicable since no relation tags are recognised.
638
639 </div>
640
641 <!-- Content End -->
642
643 <!-- Footer Start -->
644
645 <div class="footer" align="center">
646 <hr>
647
648 <address>
649 &copy; Andrew M. Bishop = &lt;amb "at" gedanken.demon.co.uk&gt;
650 </address>
651
652 </div>
653
654 <!-- Footer End -->
655
656 </BODY>
657
658 </HTML>