This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrennrad.brf
338 lines (295 loc) · 14.8 KB
/
rennrad.brf
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# copy from default profile
# adjusted surfacepenalty and increased cycleway penalty
#
# A fastbike could be a racing bike or a speed pedelec.
# But also at night or in rainy weather you might want
# to fallback to this one.
#
# Structure is similar to trekking.brf, see this for documenation.
#
# With default configuration (tested for Europe), trunks are
# strongly avoided even if there's no bike restriction
# (assuming implicit bicycle=no), and motorways are not allowed
# even with bicycle=yes). This is not the expected behavior for some countries
# such as Japan or Australia.
# Then, you should switch allow_motorways variable to true for these regions.
#
---context:global # following code refers to global config
# Bike profile
assign validForBikes = true
# Use the following switches to change behaviour
assign allow_steps = true # %allow_steps% | Set to false to disallow steps | boolean
assign allow_ferries = true # %allow_ferries% | set to false to disallow ferries | boolean
assign ignore_cycleroutes = false # %ignore_cycleroutes% | Set to true for better elevation results | boolean
assign stick_to_cycleroutes = false # %stick_to_cycleroutes% | Set to true to just follow cycleroutes | boolean
assign avoid_unsafe = false # %avoid_unsafe% | Set to true to avoid standard highways | boolean
assign considerTurnRestrictions = false # %considerTurnRestrictions% | Set to true to take turn restrictions into account | boolean
assign processUnusedTags = false # %processUnusedTags% | Set to true to output unused tags in data tab | boolean
assign consider_traffic = true # %consider_traffic% | Set to true to avoid traffic | boolean
assign allow_motorways = false # %allow_motorways% | Set to true to allow motorways (useful in Asia / Oceania for example) | boolean
# Change elevation parameters
assign consider_elevation = true # %consider_elevation% | Set to false to ignore elevation in routing | boolean
assign downhillcost = 60 # %downhillcost% | Cost for going downhill | number
assign downhillcutoff = 1.5 # %downhillcutoff% | Gradients below this value in percents are not counted. | number
assign uphillcost = 0 # %uphillcost% | Cost for going uphill | number
assign uphillcutoff = 1.5 # %uphillcutoff% | Gradients below this value in percents are not counted. | number
assign downhillcost = if consider_elevation then downhillcost else 0
assign uphillcost = if consider_elevation then uphillcost else 0
# Kinematic model parameters (travel time computation)
assign totalMass = 90 # %totalMass% | Mass (in kg) of the bike + biker, for travel time computation | number
assign maxSpeed = 45 # %maxSpeed% | Absolute maximum speed (in km/h), for travel time computation | number
assign S_C_x = 0.225 # %S_C_x% | Drag coefficient times the reference area (in m^2), for travel time computation | number
assign C_r = 0.01 # %C_r% | Rolling resistance coefficient (dimensionless), for travel time computation | number
assign bikerPower = 100 # %bikerPower% | Average power (in W) provided by the biker, for travel time computation | number
# Turn instructions settings
assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style]
assign turnInstructionCatchingRange = 40 # %turnInstructionCatchingRange% | Within this distance (in m) several turning instructions are combined into one and the turning angles are better approximated to the general direction | number
assign turnInstructionRoundabouts = true # %turnInstructionRoundabouts% | Set to "false" to avoid generating special turning instructions for roundabouts | boolean
---context:way # following code refers to way-tags
assign any_cycleroute or route_bicycle_icn=yes or route_bicycle_ncn=yes or route_bicycle_rcn=yes route_bicycle_lcn=yes
assign nodeaccessgranted or any_cycleroute lcn=yes
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign isunpaved not or surface= or ispaved or surface=fine_gravel surface=cobblestone
assign turncost = if junction=roundabout then 0
else 180
assign initialcost switch route=ferry 10000 0
#
# implicit access here just from the motorroad tag
# (implicit access rules from highway tag handled elsewhere)
#
assign defaultaccess
switch access=
(
if motorroad=yes then false
else if highway=motorway|motorway_link then false
else true
)
switch or access=private access=no
false
true
#
# calculate logical bike access
#
assign bikeaccess =
or any_cycleroute
switch bicycle=
switch bicycle_road=yes
true
switch vehicle=
( if highway=footway then false else defaultaccess )
not vehicle=private|no
not or bicycle=private or bicycle=no bicycle=dismount
#
# calculate logical foot access
#
assign footaccess =
or bikeaccess
or bicycle=dismount
switch foot=
defaultaccess
not or foot=private foot=no
#
# if not bike-, but foot-acess, just a moderate penalty,
# otherwise access is forbidden
#
assign accesspenalty
switch bikeaccess
0
switch footaccess
6
10000
#
# handle one-ways. On primary roads, wrong-oneways should
# be close to forbidden, while on other ways we just add
# 6 to the costfactor (making it at least 7 - you are allowed
# to push your bike)
#
assign badoneway =
if reversedirection=yes then
if oneway:bicycle=yes then true
else if oneway= then junction=roundabout
else oneway=yes|true|1
else oneway=-1
assign onewaypenalty =
if ( badoneway ) then
(
if ( cycleway=opposite|opposite_lane|opposite_track ) then 0
else if ( oneway:bicycle=no ) then 0
else if ( highway=primary|primary_link ) then 50
else if ( highway=secondary|secondary_link ) then 30
else if ( highway=tertiary|tertiary_link ) then 20
else 6.0
)
else 0.0
# Eventually compute traffic penalty
assign hascycleway = not
and ( or cycleway= cycleway=no|none ) and ( or cycleway:left= cycleway:left=no ) ( or cycleway:right= cycleway:right=no )
assign trafficpenalty0 =
if highway=primary|primary_link then
(
if estimated_traffic_class=4 then 0.2
else if estimated_traffic_class=5 then 0.4
else if estimated_traffic_class=6|7 then 0.6
else 0
)
else if highway=secondary|secondary_link then
(
if estimated_traffic_class=3 then 0.2
else if estimated_traffic_class=4 then 0.4
else if estimated_traffic_class=5 then 0.6
else if estimated_traffic_class=6|7 then 1
else 0
)
else if highway=tertiary|tertiary_link then
(
if estimated_traffic_class=2 then 0.1
else if estimated_traffic_class=3 then 0.3
else if estimated_traffic_class=4 then 0.5
else if estimated_traffic_class=5|6|7 then 1
else 0
)
else 0
assign trafficpenalty =
if consider_traffic then
(
if hascycleway then min 0.3 trafficpenalty0
else trafficpenalty0
)
else 0
assign smoothnesspenalty =
switch smoothness=intermediate 0.3
switch smoothness=bad 1
switch smoothness=very_bad 2
switch smoothness=horrible 4.5
0
assign surfacepenalty
switch surface=asphalt 0
switch surface=sett switch smoothness=good|excellent 0.1 0.3 # behauene Pflastersteine
switch surface=paved switch smoothness=good|excellent 0.1 0.3 # befestigte(harte)Oberfl sche
switch concrete=plates 1 # Betonplattenwege
switch surface=concrete|paving_stones|wood|metal 0.8 # Beton, Pflastersteine (geschnitzt), Holz, Metall
switch surface=cobblestone|sett switch smoothness=good|excellent 1 2 # Kopfsteinpflaster
# switch surface=unhewn_cobblestone 3 # ungeschnitzter Pflasterstein
switch concrete=lanes 3 # Betonspurplatten
switch surface=fine_gravel|compacted 4 # Splitt,verdichtete Oberflaesche
switch surface=grass_paver 5 # Rasengittersteine
switch surface=gravel|sand|pebblestone|unpaved 10 # Schotter, Sand, Kies, unbefestigt
switch surface=ground|grass|dirt|earth|mud|clay 25 # naturbelassene Oberfl sche, Gras, Schutz Schlamm...
# if "surface" is not defined...
switch surface=
# then, for Primary, secondary and tertiary asphalt is very probable
switch highway=primary|primary_link|secondary|secondary_link|tertiary|tertiary_link 0
# then, for residential & Co. probably asphalt..
switch highway=road|residential|unclassified 0.1
# then, for living_street something paved ..
switch highway=living_street 0.3
# then, for "service & cycleway" possibly good (but not sure!) ...
switch highway=service|cycleway 0.5
# in some cases only smoothness is tagged but surface not!
switch smoothness=intermediate|good|excellent 0
# else, check if tracktype=grade1, then it is "something" paved, so middle penalty
switch tracktype=grade1 0.9
# if a cycleroute is defined, surface can not be horrible...
switch any_cycleroute 3.5 5
# surface not known and probably not paved / no asphalt...
5
assign isresidentialorliving = or highway=residential|living_street living_street=yes
assign costfactor
switch and highway= not route=ferry 10000
switch or highway=proposed highway=abandoned 10000
min 9999
add max onewaypenalty accesspenalty
add trafficpenalty
add smoothnesspenalty
add surfacepenalty
switch or highway=motorway highway=motorway_link switch allow_motorways 1.5 10000
switch or highway=trunk highway=trunk_link switch allow_motorways 1.5 10
switch or highway=primary highway=primary_link 2.2
switch or highway=secondary highway=secondary_link 2.0
switch or highway=tertiary highway=tertiary_link 1.0
switch highway=unclassified 1.1
switch highway=pedestrian 10
switch highway=steps 1000
switch route=ferry 5.67
switch highway=bridleway 5
switch highway=cycleway 1.5
switch isresidentialorliving switch isunpaved 10 1.2
switch highway=service switch isunpaved 10 1.2
switch or highway=track or highway=road or highway=path highway=footway
switch tracktype=grade1 switch isunpaved 3 1.2
switch tracktype=grade2 switch isunpaved 10 3
switch tracktype=grade3 10.0
switch tracktype=grade4 20.0
switch tracktype=grade5 30.0
switch or bicycle=designated bicycle_road=yes 2.0
switch ispaved 2.0 100.0
10.0
# way priorities used for voice hint generation
assign priorityclassifier =
if ( highway=motorway ) then 30
else if ( highway=motorway_link ) then 29
else if ( highway=trunk ) then 28
else if ( highway=trunk_link ) then 27
else if ( highway=primary ) then 26
else if ( highway=primary_link ) then 25
else if ( highway=secondary ) then 24
else if ( highway=secondary_link ) then 23
else if ( highway=tertiary ) then 22
else if ( highway=tertiary_link ) then 21
else if ( highway=unclassified ) then 20
else if ( isresidentialorliving ) then 6
else if ( highway=service ) then 6
else if ( highway=cycleway ) then 6
else if ( or bicycle=designated bicycle_road=yes ) then 6
else if ( highway=track ) then if tracktype=grade1 then 6 else 4
else if ( highway=bridleway|road|path|footway ) then 4
else if ( highway=steps ) then 2
else if ( highway=pedestrian ) then 2
else 0
# some more classifying bits used for voice hint generation...
assign isbadoneway = not equal onewaypenalty 0
assign isgoodoneway = if reversedirection=yes then oneway=-1
else if oneway= then junction=roundabout else oneway=yes|true|1
assign isroundabout = junction=roundabout
assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link
assign isgoodforcars = if greater priorityclassifier 6 then true
else if ( or isresidentialorliving highway=service ) then true
else if ( and highway=track tracktype=grade1 ) then true
else false
# ... encoded into a bitmask
assign classifiermask add isbadoneway
add multiply isgoodoneway 2
add multiply isroundabout 4
add multiply islinktype 8
multiply isgoodforcars 16
---context:node # following code refers to node tags
assign defaultaccess
switch access=
1 # add default barrier restrictions here!
switch or access=private access=no
0
1
assign bikeaccess
or nodeaccessgranted=yes
switch bicycle=
switch vehicle=
defaultaccess
switch or vehicle=private vehicle=no
0
1
switch or bicycle=private or bicycle=no bicycle=dismount
0
1
assign footaccess
or bicycle=dismount
switch foot=
defaultaccess
switch or foot=private foot=no
0
1
assign initialcost
switch bikeaccess
0
switch footaccess
300
1000000