Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/doc/html/configuration.html
Parent Directory
|
Revision Log
Revision 586 -
(show annotations)
(download)
(as text)
Wed Dec 29 10:56:09 2010 UTC (14 years, 2 months ago) by amb
File MIME type: text/html
File size: 8166 byte(s)
Wed Dec 29 10:56:09 2010 UTC (14 years, 2 months ago) by amb
File MIME type: text/html
File size: 8166 byte(s)
Added the uncontrolled (not auto-generated) files from routino-1.5.1.
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 - configuration |
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 : Configuration</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 : Configuration</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>XML Configuration Files</h2> |
49 | |
50 | New in version 1.4 of Routino is the use of configuration files to allow more |
51 | information to be provided to the programs at run-time. The configuration files |
52 | that are used are: |
53 | <ul> |
54 | <li>Tagging transformation rules for the <em>planetsplitter</em> program. |
55 | <li>Routing profiles for the <em>router</em> program. |
56 | <li>Output translations for the <em>router</em> program. |
57 | </ul> |
58 | |
59 | In keeping with the nature of the input and output files the configuration files |
60 | are also XML files. Each of the files uses a custom defined XML schema and an |
61 | XSD file is provided for each of them. |
62 | |
63 | <h3><a name="H_1_1_1" title="Tagging rules"></a>Tag Transformation Rules</h3> |
64 | |
65 | The default name of the tagging transformation rules XML configuration file |
66 | is <em>tagging.xml</em> in the same directory as the generated database files. |
67 | Other filenames can be specified on the command line using |
68 | the <tt>--tagging</tt> option. When processing the input it is possible to have |
69 | a different set of tagging rules for each file; for example different rules for |
70 | different countries. |
71 | |
72 | <p> |
73 | |
74 | The tagging rules allow modifying the highway tags in the source file so that |
75 | the routing can be performed on a simpler set of tags. This removes the special |
76 | case tagging rules from the source code into the configuration file where they |
77 | can be easily modified. Part of the provided tagging.xml file showing the rules |
78 | for motorway_link and motorway highway types. |
79 | |
80 | <pre class="boxed"> |
81 | <?xml version="1.0" encoding="utf-8"?> |
82 | <routino-tagging> |
83 | |
84 | <way> |
85 | |
86 | <if k="highway" v="motorway_link"> |
87 | <set v="motorway"/> |
88 | </if> |
89 | |
90 | <if k="highway" v="motorway"> |
91 | <output k="highway"/> |
92 | |
93 | <output k="motorbike" v="yes"/> |
94 | <output k="motorcar" v="yes"/> |
95 | <output k="goods" v="yes"/> |
96 | <output k="hgv" v="yes"/> |
97 | <output k="psv" v="yes"/> |
98 | |
99 | <output k="paved" v="yes"/> |
100 | <output k="multilane" v="yes"/> |
101 | <output k="oneway" v="yes"/> |
102 | </if> |
103 | ... |
104 | <way> |
105 | |
106 | </routino-tagging> |
107 | </pre> |
108 | |
109 | The rules all have the same format; an <em>if</em> element for matching the |
110 | input and some <em>set</em> or <em>output</em> elements to either change the |
111 | input tags or create an output tag. The <em>k</em> and <em>v</em> attributes |
112 | have the same meaning as the attributes with the same names in the OSM XML file |
113 | - the tag key and tag value. |
114 | |
115 | <p> |
116 | |
117 | An <em>if</em> rule that has both <em>k</em> and <em>v</em> specified is only |
118 | applied if a tag exists in the input that matches both. An <em>if</em> rule |
119 | that has only the <em>k</em> attribute is applied if a tag with that key exists |
120 | and an <em>if</em> rule that has only the <em>v</em> attribute is applied to all |
121 | tags with that value. |
122 | |
123 | <p> |
124 | |
125 | For the <em>set</em> and <em>output</em> elements the tag that is created in the |
126 | input or output tag set uses the <em>k</em> and <em>v</em> attributes specified. |
127 | If one or both are not specified then the original ones are used. |
128 | |
129 | |
130 | <h3><a name="H_1_1_2" title="Profiles"></a>Routing Profiles</h3> |
131 | |
132 | The default name of the routing profiles XML configuration file |
133 | is <em>profiles.xml</em> in the same directory as the database files. Other |
134 | filenames can be specified on the command line using the <tt>--tagging</tt> |
135 | option. |
136 | |
137 | <p> |
138 | |
139 | The purpose of this configuration file is to allow easy modification of the |
140 | routing parameters so that they do not all need to be specified on the command |
141 | line. In versions of Routino before version 1.4 the default routing parameters |
142 | (preferred highways, preferred speeds etc) were contained in the source code, |
143 | now they are in a configuration file. When calculating a route |
144 | the <tt>--profile</tt> option selects the named profile from the configuration |
145 | file. |
146 | |
147 | <p> |
148 | |
149 | Part of the provided profiles.xml file showing the parameters for transport on |
150 | foot is shown below: |
151 | |
152 | <pre class="boxed"> |
153 | <?xml version="1.0" encoding="UTF-8" ?> |
154 | <routino-profiles> |
155 | |
156 | <profile name="foot" transport="foot"> |
157 | <speeds> |
158 | ... |
159 | <speed highway="cycleway" kph="4" /> |
160 | <speed highway="path" kph="4" /> |
161 | <speed highway="steps" kph="4" /> |
162 | </speeds> |
163 | <preferences> |
164 | ... |
165 | <preference highway="cycleway" percent="95" /> |
166 | <preference highway="path" percent="100" /> |
167 | <preference highway="steps" percent="80" /> |
168 | </preferences> |
169 | <properties> |
170 | <property type="paved" percent="50" /> |
171 | <property type="multilane" percent="25" /> |
172 | <property type="bridge" percent="50" /> |
173 | <property type="tunnel" percent="50" /> |
174 | ... |
175 | </properties> |
176 | <restrictions> |
177 | <oneway obey="0" /> |
178 | <weight limit="0.0" /> |
179 | <height limit="0.0" /> |
180 | <width limit="0.0" /> |
181 | <length limit="0.0" /> |
182 | </restrictions> |
183 | </profile> |
184 | <profile name="horse" transport="horse"> |
185 | ... |
186 | </profile> |
187 | ... |
188 | </routino-profiles> |
189 | </pre> |
190 | |
191 | |
192 | <h3><a name="H_1_1_3" title="Translations"></a>Output Translations</h3> |
193 | |
194 | The default name of the output translations XML configuration file |
195 | is <em>translations.xml</em> in the same directory as the database files. Other |
196 | filenames can be specified on the command line using the <tt>--translations</tt> |
197 | option. |
198 | |
199 | <p> |
200 | |
201 | The generated HTML and GPX output files (described in the next section) are |
202 | created using the fragments of text that are defined in this file. Additional |
203 | languages can be added to the file and are selected using |
204 | the <tt>--language</tt> option to the router. If no language is specified the |
205 | first one in the file is used. |
206 | |
207 | <p> |
208 | |
209 | Part of the provided translations.xml file showing some of the English language |
210 | (en) translations is shown below: |
211 | |
212 | <pre class="boxed"> |
213 | <?xml version="1.0" encoding="utf-8"?> |
214 | <routino-translations> |
215 | |
216 | <language lang="en"> |
217 | ... |
218 | <turn direction="-4" string="Very sharp left" /> |
219 | <turn direction="-3" string="Sharp left" /> |
220 | <turn direction="-2" string="Left" /> |
221 | ... |
222 | <heading direction="-4" string="South" /> |
223 | <heading direction="-3" string="South-West" /> |
224 | <heading direction="-2" string="West" /> |
225 | ... |
226 | <route type="shortest" string="Shortest" /> |
227 | <route type="quickest" string="Quickest" /> |
228 | <output-html> |
229 | ... |
230 | </output-html> |
231 | <output-gpx> |
232 | ... |
233 | </output-gpx> |
234 | </language> |
235 | </routino-translations> |
236 | </pre> |
237 | |
238 | </div> |
239 | |
240 | <!-- Content End --> |
241 | |
242 | <!-- Footer Start --> |
243 | |
244 | <div class="footer" align="center"> |
245 | <hr> |
246 | |
247 | <address> |
248 | © Andrew M. Bishop = <amb "at" gedanken.demon.co.uk> |
249 | </address> |
250 | |
251 | </div> |
252 | |
253 | <!-- Footer End --> |
254 | |
255 | </BODY> |
256 | |
257 | </HTML> |