Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /branches/destination-access/doc/html/configuration.html
Parent Directory
|
Revision Log
Revision 1474 -
(hide annotations)
(download)
(as text)
Tue Dec 31 10:35:13 2013 UTC (11 years, 2 months ago) by amb
Original Path: trunk/doc/html/configuration.html
File MIME type: text/html
File size: 10519 byte(s)
Tue Dec 31 10:35:13 2013 UTC (11 years, 2 months ago) by amb
Original Path: trunk/doc/html/configuration.html
File MIME type: text/html
File size: 10519 byte(s)
Update HTML ready for HTML5 but keeping HTML4.01 strict DTD (anchors with names are deprecated).
1 | amb | 1469 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
2 | <html> | ||
3 | amb | 577 | |
4 | amb | 1469 | <head> |
5 | amb | 1257 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
6 | |||
7 | <title>Routino : Configuration</title> | ||
8 | |||
9 | amb | 577 | <!-- |
10 | amb | 584 | Routino documentation - configuration |
11 | amb | 577 | |
12 | Part of the Routino routing software. | ||
13 | |||
14 | amb | 1242 | This file Copyright 2008-2013 Andrew M. Bishop |
15 | amb | 577 | |
16 | This program is free software: you can redistribute it and/or modify | ||
17 | it under the terms of the GNU Affero General Public License as published by | ||
18 | the Free Software Foundation, either version 3 of the License, or | ||
19 | (at your option) any later version. | ||
20 | |||
21 | This program is distributed in the hope that it will be useful, | ||
22 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | GNU Affero General Public License for more details. | ||
25 | |||
26 | You should have received a copy of the GNU Affero General Public License | ||
27 | along with this program. If not, see http://www.gnu.org/licenses/. | ||
28 | --> | ||
29 | |||
30 | amb | 1257 | <link href="style.css" type="text/css" rel="stylesheet"> |
31 | amb | 1469 | </head> |
32 | amb | 577 | |
33 | amb | 1469 | <body> |
34 | amb | 577 | |
35 | <!-- Header Start --> | ||
36 | |||
37 | amb | 1469 | <div class="header"> |
38 | amb | 577 | |
39 | <h1>Routino : Configuration</h1> | ||
40 | |||
41 | <hr> | ||
42 | </div> | ||
43 | |||
44 | <!-- Header End --> | ||
45 | |||
46 | <!-- Content Start --> | ||
47 | |||
48 | <div class="content"> | ||
49 | |||
50 | amb | 1474 | <h2 id="H_1_1">XML Configuration Files</h2> |
51 | amb | 577 | |
52 | amb | 585 | New in version 1.4 of Routino is the use of configuration files to allow more |
53 | amb | 577 | information to be provided to the programs at run-time. The configuration files |
54 | that are used are: | ||
55 | <ul> | ||
56 | <li>Tagging transformation rules for the <em>planetsplitter</em> program. | ||
57 | <li>Routing profiles for the <em>router</em> program. | ||
58 | <li>Output translations for the <em>router</em> program. | ||
59 | </ul> | ||
60 | |||
61 | In keeping with the nature of the input and output files the configuration files | ||
62 | are also XML files. Each of the files uses a custom defined XML schema and an | ||
63 | XSD file is provided for each of them. | ||
64 | |||
65 | amb | 1474 | <h3 id="H_1_1_1" title="Tagging rules">Tag Transformation Rules</h3> |
66 | amb | 577 | |
67 | The default name of the tagging transformation rules XML configuration file | ||
68 | is <em>tagging.xml</em> in the same directory as the generated database files. | ||
69 | Other filenames can be specified on the command line using | ||
70 | the <tt>--tagging</tt> option. When processing the input it is possible to have | ||
71 | a different set of tagging rules for each file; for example different rules for | ||
72 | different countries. | ||
73 | |||
74 | <p> | ||
75 | |||
76 | The tagging rules allow modifying the highway tags in the source file so that | ||
77 | the routing can be performed on a simpler set of tags. This removes the special | ||
78 | case tagging rules from the source code into the configuration file where they | ||
79 | can be easily modified. Part of the provided tagging.xml file showing the rules | ||
80 | for motorway_link and motorway highway types. | ||
81 | |||
82 | <pre class="boxed"> | ||
83 | <?xml version="1.0" encoding="utf-8"?> | ||
84 | <routino-tagging> | ||
85 | |||
86 | <way> | ||
87 | |||
88 | <if k="highway" v="motorway_link"> | ||
89 | <set v="motorway"/> | ||
90 | </if> | ||
91 | |||
92 | <if k="highway" v="motorway"> | ||
93 | <output k="highway"/> | ||
94 | |||
95 | amb | 1243 | <output k="motorcycle" v="yes"/> |
96 | amb | 577 | <output k="motorcar" v="yes"/> |
97 | <output k="goods" v="yes"/> | ||
98 | <output k="hgv" v="yes"/> | ||
99 | <output k="psv" v="yes"/> | ||
100 | |||
101 | <output k="paved" v="yes"/> | ||
102 | <output k="multilane" v="yes"/> | ||
103 | <output k="oneway" v="yes"/> | ||
104 | amb | 1203 | |
105 | <unset k="highway"/> | ||
106 | amb | 577 | </if> |
107 | ... | ||
108 | <way> | ||
109 | |||
110 | </routino-tagging> | ||
111 | </pre> | ||
112 | |||
113 | amb | 1206 | The rules all have the same format; an <em>if</em> or <em>ifnot</em> element at |
114 | the top level for matching the input and some other elements inside to be used | ||
115 | if there was a match. | ||
116 | amb | 577 | |
117 | <p> | ||
118 | |||
119 | amb | 1206 | Within the <em>if</em> and <em>ifnot</em> rules any of the rules can be used. |
120 | These are <em>if</em>, <em>ifnot</em>, <em>set</em>, <em>unset</em>, | ||
121 | <em>output</em> or <em>logerror</em> elements. | ||
122 | amb | 577 | |
123 | <p> | ||
124 | |||
125 | amb | 1206 | The rules for matching the <em>if</em> or <em>ifnot</em> elements are the |
126 | following: | ||
127 | amb | 577 | |
128 | amb | 1206 | <ul> |
129 | <li>An <em>if</em> rule that has both <em>k</em> and <em>v</em> specified is | ||
130 | only matched if a tag exists in the input that matches both. | ||
131 | <li>An <em>if</em> rule that has only the <em>k</em> attribute is matched if a | ||
132 | tag with that key exists. | ||
133 | <li>An <em>if</em> rule that has only the <em>v</em> attribute is matched for | ||
134 | each tag with that value (i.e. the contents may be used more than once). | ||
135 | <li>An <em>if</em> rule that has neither attribute specified always matches. | ||
136 | <li>An <em>ifnot</em> rule that has both <em>k</em> and <em>v</em> specified | ||
137 | is only matched if no tag exists in the input that matches both. | ||
138 | <li>An <em>ifnot</em> rule that has only the <em>k</em> attribute is matched | ||
139 | only if no tag with that key exists. | ||
140 | <li>An <em>ifnot</em> rule that has only the <em>v</em> attribute is only | ||
141 | matched if no tag with that value exists. | ||
142 | <li>An <em>ifnot</em> rule that has neither attribute specified never matches. | ||
143 | </ul> | ||
144 | |||
145 | amb | 1203 | <p> |
146 | amb | 577 | |
147 | amb | 1206 | For <em>set</em>, <em>unset</em>, <em>output</em> or <em>logerror</em> elements |
148 | inside of an <em>if</em> rule an unspecified value for the <em>k</em> | ||
149 | or <em>v</em> attribute is replaced by the values from the tag that matched the | ||
150 | outer <em>if</em> rule. This makes it simple to delete tags that match a | ||
151 | particular rule without having to specify the parameters more than once. For | ||
152 | elements inside of an <em>ifnot</em> element an unspecified value for | ||
153 | the <em>k</em> or <em>v</em> attribute is replaced by the values from the | ||
154 | outer <em>ifnot</em> rule. This means that either the outer <em>ifnot</em> | ||
155 | element or the inner element must specify both <em>k</em> and <em>v</em> | ||
156 | attributes between them. For nested <em>if</em> or <em>ifnot</em> elements the | ||
157 | outer <em>k</em> and <em>v</em> attributes are not inherited by the inner | ||
158 | elements. | ||
159 | |||
160 | <p> | ||
161 | |||
162 | The <em>set</em> and <em>unset</em> elements either create or delete a tag from | ||
163 | the input data that was read from the file. If the <em>set</em> element is used | ||
164 | and the tag already exists then it is modified. The <em>output</em> element | ||
165 | adds a tag to the set that will be used by Routino to determine the data | ||
166 | properties. | ||
167 | |||
168 | <p> | ||
169 | |||
170 | amb | 1203 | The <em>logerror</em> element will cause an error message to be added to the |
171 | error log file that reports that the key and attribute combination are not | ||
172 | amb | 1242 | recognised. If the <em>k</em> attribute is specified but not the <em>v</em> |
173 | attribute then the tag value that matches the specified key is looked up and | ||
174 | used. An additional <em>message</em> attribute can be specified to be printed | ||
175 | at the end of the logged error. | ||
176 | amb | 1203 | |
177 | amb | 1242 | <p> |
178 | The default logged error message is: | ||
179 | <pre class="boxed"> | ||
180 | Node XXX has an unrecognised tag 'key' = 'value' (in tagging rules); ignoring it. | ||
181 | </pre> | ||
182 | amb | 1203 | |
183 | amb | 1242 | <p> |
184 | The specified <em>message</em> attribute will replace the final part of the | ||
185 | logged error. | ||
186 | |||
187 | |||
188 | amb | 1474 | <h3 id="H_1_1_2" title="Profiles">Routing Profiles</h3> |
189 | amb | 577 | |
190 | The default name of the routing profiles XML configuration file | ||
191 | is <em>profiles.xml</em> in the same directory as the database files. Other | ||
192 | filenames can be specified on the command line using the <tt>--tagging</tt> | ||
193 | option. | ||
194 | |||
195 | <p> | ||
196 | |||
197 | The purpose of this configuration file is to allow easy modification of the | ||
198 | routing parameters so that they do not all need to be specified on the command | ||
199 | line. In versions of Routino before version 1.4 the default routing parameters | ||
200 | (preferred highways, preferred speeds etc) were contained in the source code, | ||
201 | now they are in a configuration file. When calculating a route | ||
202 | the <tt>--profile</tt> option selects the named profile from the configuration | ||
203 | file. | ||
204 | |||
205 | <p> | ||
206 | |||
207 | Part of the provided profiles.xml file showing the parameters for transport on | ||
208 | foot is shown below: | ||
209 | |||
210 | <pre class="boxed"> | ||
211 | <?xml version="1.0" encoding="UTF-8" ?> | ||
212 | <routino-profiles> | ||
213 | |||
214 | <profile name="foot" transport="foot"> | ||
215 | <speeds> | ||
216 | ... | ||
217 | <speed highway="cycleway" kph="4" /> | ||
218 | <speed highway="path" kph="4" /> | ||
219 | <speed highway="steps" kph="4" /> | ||
220 | </speeds> | ||
221 | <preferences> | ||
222 | ... | ||
223 | <preference highway="cycleway" percent="95" /> | ||
224 | <preference highway="path" percent="100" /> | ||
225 | <preference highway="steps" percent="80" /> | ||
226 | </preferences> | ||
227 | <properties> | ||
228 | amb | 585 | <property type="paved" percent="50" /> |
229 | <property type="multilane" percent="25" /> | ||
230 | <property type="bridge" percent="50" /> | ||
231 | <property type="tunnel" percent="50" /> | ||
232 | amb | 586 | ... |
233 | amb | 577 | </properties> |
234 | <restrictions> | ||
235 | <oneway obey="0" /> | ||
236 | <weight limit="0.0" /> | ||
237 | <height limit="0.0" /> | ||
238 | <width limit="0.0" /> | ||
239 | <length limit="0.0" /> | ||
240 | </restrictions> | ||
241 | </profile> | ||
242 | <profile name="horse" transport="horse"> | ||
243 | ... | ||
244 | </profile> | ||
245 | ... | ||
246 | </routino-profiles> | ||
247 | </pre> | ||
248 | |||
249 | |||
250 | amb | 1474 | <h3 id="H_1_1_3" title="Translations">Output Translations</h3> |
251 | amb | 577 | |
252 | The default name of the output translations XML configuration file | ||
253 | is <em>translations.xml</em> in the same directory as the database files. Other | ||
254 | filenames can be specified on the command line using the <tt>--translations</tt> | ||
255 | option. | ||
256 | |||
257 | <p> | ||
258 | |||
259 | The generated HTML and GPX output files (described in the next section) are | ||
260 | created using the fragments of text that are defined in this file. Additional | ||
261 | languages can be added to the file and are selected using | ||
262 | the <tt>--language</tt> option to the router. If no language is specified the | ||
263 | first one in the file is used. | ||
264 | |||
265 | <p> | ||
266 | |||
267 | Part of the provided translations.xml file showing some of the English language | ||
268 | (en) translations is shown below: | ||
269 | |||
270 | <pre class="boxed"> | ||
271 | <?xml version="1.0" encoding="utf-8"?> | ||
272 | <routino-translations> | ||
273 | |||
274 | <language lang="en"> | ||
275 | ... | ||
276 | <turn direction="-4" string="Very sharp left" /> | ||
277 | <turn direction="-3" string="Sharp left" /> | ||
278 | <turn direction="-2" string="Left" /> | ||
279 | ... | ||
280 | <heading direction="-4" string="South" /> | ||
281 | <heading direction="-3" string="South-West" /> | ||
282 | <heading direction="-2" string="West" /> | ||
283 | ... | ||
284 | <route type="shortest" string="Shortest" /> | ||
285 | <route type="quickest" string="Quickest" /> | ||
286 | <output-html> | ||
287 | ... | ||
288 | </output-html> | ||
289 | <output-gpx> | ||
290 | ... | ||
291 | </output-gpx> | ||
292 | </language> | ||
293 | </routino-translations> | ||
294 | </pre> | ||
295 | |||
296 | </div> | ||
297 | |||
298 | <!-- Content End --> | ||
299 | |||
300 | <!-- Footer Start --> | ||
301 | |||
302 | amb | 1469 | <div class="footer"> |
303 | amb | 577 | <hr> |
304 | |||
305 | <address> | ||
306 | amb | 1267 | © Andrew M. Bishop - <a href="http://www.routino.org/">http://www.routino.org/</a> |
307 | amb | 577 | </address> |
308 | |||
309 | </div> | ||
310 | |||
311 | <!-- Footer End --> | ||
312 | |||
313 | amb | 1469 | </body> |
314 | amb | 577 | |
315 | amb | 1469 | </html> |