File: CONFIGURATION.txt

package info (click to toggle)
routino 3.2-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,376 kB
  • sloc: ansic: 22,337; xml: 5,520; perl: 2,485; makefile: 753; sh: 661
file content (219 lines) | stat: -rw-r--r-- 8,134 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
                           Routino : Configuration
                           =======================


   New in version 1.4 of Routino is the use of configuration files to
   allow more information to be provided to the programs at run-time. The
   configuration files that are used are:
     * Tagging transformation rules for the planetsplitter program.
     * Routing profiles for the router program.
     * Output translations for the router program.

   In keeping with the nature of the input and output files the
   configuration files are also XML files. Each of the files uses a custom
   defined XML schema and an XSD file is provided for each of them.


Tag Transformation Rules
------------------------

   The default name of the tagging transformation rules XML configuration
   file is tagging.xml in the same directory as the generated database
   files. Other filenames can be specified on the command line using the
   --tagging option. When processing the input it is possible to have a
   different set of tagging rules for each file; for example different
   rules for different countries.

   The tagging rules allow modifying the highway tags in the source file
   so that the routing can be performed on a simpler set of tags. This
   removes the special case tagging rules from the source code into the
   configuration file where they can be easily modified. Part of the
   provided tagging.xml file showing the rules for motorway_link and
   motorway highway types.

<?xml version="1.0" encoding="utf-8"?>
<routino-tagging>

  <way>

    <if k="highway" v="motorway_link">
      <set v="motorway"/>
    </if>

    <if k="highway" v="motorway">
      <output k="highway"/>

      <output k="motorcycle" v="yes"/>
      <output k="motorcar"   v="yes"/>
      <output k="goods"      v="yes"/>
      <output k="hgv"        v="yes"/>
      <output k="psv"        v="yes"/>

      <output k="paved"      v="yes"/>
      <output k="multilane"  v="yes"/>
      <output k="oneway"     v="yes"/>

      <unset k="highway"/>
    </if>
...
  <way>

</routino-tagging>

   The rules all have the same format; an if or ifnot element at the top
   level for matching the input and some other elements inside to be used
   if there was a match.

   Within the if and ifnot rules any of the rules can be used. These are
   if, ifnot, set, unset, output or logerror elements.

   The rules for matching the if or ifnot elements are the following:
     * An if rule that has both k and v specified is only matched if a tag
       exists in the input that matches both.
     * An if rule that has only the k attribute is matched if a tag with
       that key exists.
     * An if rule that has only the v attribute is matched for each tag
       with that value (i.e. the contents may be used more than once).
     * An if rule that has neither attribute specified always matches.
     * An ifnot rule that has both k and v specified is only matched if no
       tag exists in the input that matches both.
     * An ifnot rule that has only the k attribute is matched only if no
       tag with that key exists.
     * An ifnot rule that has only the v attribute is only matched if no
       tag with that value exists.
     * An ifnot rule that has neither attribute specified never matches.

   For set, unset, output or logerror elements inside of an if rule an
   unspecified value for the k or v attribute is replaced by the values
   from the tag that matched the outer if rule. This makes it simple to
   delete tags that match a particular rule without having to specify the
   parameters more than once. For elements inside of an ifnot element an
   unspecified value for the k or v attribute is replaced by the values
   from the outer ifnot rule. This means that either the outer ifnot
   element or the inner element must specify both k and v attributes
   between them. For nested if or ifnot elements the outer k and v
   attributes are not inherited by the inner elements.

   The set and unset elements either create or delete a tag from the input
   data that was read from the file. If the set element is used and the
   tag already exists then it is modified. The output element adds a tag
   to the set that will be used by Routino to determine the data
   properties.

   The logerror element will cause an error message to be added to the
   error log file that reports that the key and attribute combination are
   not recognised. If the k attribute is specified but not the v attribute
   then the tag value that matches the specified key is looked up and
   used. An additional message attribute can be specified to be printed at
   the end of the logged error.

   The default logged error message is:

   Node XXX has an unrecognised tag 'key' = 'value' (in tagging rules); ignoring it.

   The specified message attribute will replace the final part of the
   logged error.


Routing Profiles
----------------

   The default name of the routing profiles XML configuration file is
   profiles.xml in the same directory as the database files. Other
   filenames can be specified on the command line using the --tagging
   option.

   The purpose of this configuration file is to allow easy modification of
   the routing parameters so that they do not all need to be specified on
   the command line. In versions of Routino before version 1.4 the default
   routing parameters (preferred highways, preferred speeds etc) were
   contained in the source code, now they are in a configuration file.
   When calculating a route the --profile option selects the named profile
   from the configuration file.

   Part of the provided profiles.xml file showing the parameters for
   transport on foot is shown below:

<?xml version="1.0" encoding="UTF-8" ?>
<routino-profiles>

  <profile name="foot" transport="foot">
    <speeds>
...
      <speed highway="cycleway"      kph="4" />
      <speed highway="path"          kph="4" />
      <speed highway="steps"         kph="4" />
    </speeds>
    <preferences>
...
      <preference highway="cycleway"      percent="95" />
      <preference highway="path"          percent="100" />
      <preference highway="steps"         percent="80" />
    </preferences>
    <properties>
      <property type="paved"        percent="50" />
      <property type="multilane"    percent="25" />
      <property type="bridge"       percent="50" />
      <property type="tunnel"       percent="50" />
...
    </properties>
    <restrictions>
      <oneway obey="0" />
      <weight limit="0.0" />
      <height limit="0.0" />
      <width  limit="0.0" />
      <length limit="0.0" />
    </restrictions>
  </profile>
  <profile name="horse" transport="horse">
...
  </profile>
...
</routino-profiles>


Output Translations
-------------------

   The default name of the output translations XML configuration file is
   translations.xml in the same directory as the database files. Other
   filenames can be specified on the command line using the --translations
   option.

   The generated HTML and GPX output files (described in the next section)
   are created using the fragments of text that are defined in this file.
   Additional languages can be added to the file and are selected using
   the --language option to the router. If no language is specified the
   first one in the file is used.

   Part of the provided translations.xml file showing some of the English
   language (en) translations is shown below:

<?xml version="1.0" encoding="utf-8"?>
<routino-translations>

  <language lang="en">
...
    <turn direction="-4" string="Very sharp left" />
    <turn direction="-3" string="Sharp left" />
    <turn direction="-2" string="Left" />
...
    <heading direction="-4" string="South" />
    <heading direction="-3" string="South-West" />
    <heading direction="-2" string="West" />
...
    <route type="shortest" string="Shortest" />
    <route type="quickest" string="Quickest" />
    <output-html>
...
    </output-html>
    <output-gpx>
...
    </output-gpx>
  </language>
</routino-translations>


--------

Copyright 2010-2013 Andrew M. Bishop.