-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgravel.brf
More file actions
290 lines (247 loc) · 11.6 KB
/
Copy pathgravel.brf
File metadata and controls
290 lines (247 loc) · 11.6 KB
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
---context:global # following code refers to global config
assign processUnusedTags 1 # set to true if you want to display all tags in the "data"
assign validForBikes true
assign validForCars false
assign validForFoot false
#Elevation
#---------------------------
assign downhillcost 20
assign uphillcost 25
#Options
#---------------------------
assign turn_cost = 100 # %turn_cost% | To decrease the num. of direction changes, increase this value.| number
assign avoid_hiking = false # %avoid_hiking% | if you want to avoid hiking routes | boolean
assign safe_gate = false # %safe_gate% | avoid gates to not encounter closed parcs/public gardens... | boolean
---context:way # following code refers to way-tags
#Forbidden ways=>costfactor values>=10 000 (not initialcost!)
#initial costs
#---------------------------
#penalty if we have to take steps
assign steps
switch highway=steps true
false
#penalty if we have to dismount the bike
assign dismount
switch bicycle=dismount true
false
#penalty if we use an highway for pedestrians or horses
assign bad_highway
switch and highway=footway|bridleway|pedestrian bicycle=yes|permissive|designated|dismount true
false
#initial costs
#---------------------------
assign initialclassifier
switch steps 1
switch dismount 2
switch bad_highway 3
22
assign initialcost
switch steps 1000
switch dismount 1000
switch bad_highway 1000
0
#turncost
#---------------------------
#is implicitely added to costfactor
# this is the cost (in Meter) for a 90-degree turn
# The actual cost is calculated as turncost*cos(angle)
assign turncost = turn_cost
#surface (good unpaved first)
#---------------------------
assign fav_surface
switch surface=fine_gravel|compacted 0.9
switch surface=ground|dirt|earth|gravel|asphalt 1.0
switch surface=cobblestone|concrete|paving_stones|wood|sett 1.1
switch surface=paved|grass 1.2
switch surface=pebblestone|mud|sand|clay 1.3
switch surface=unpaved 1.3
switch and surface= highway=footway|pedestrian|living_street|residential 1.1
switch and surface= highway=tertiary|tertiary_link|cycleway 1.1
switch and surface= highway=secondary|secondary_link 1.0
switch and surface= highway=primary|primary_link 1.0
switch and surface= highway=unclassified|service 1.1
switch and surface= highway=track 1.4
switch and surface= highway=path|bridleway 1.4
1.4
#highway types
#---------------------------
assign fav_highway
switch highway=track 0.7
switch highway=path 0.8
switch highway=unclassified|service 0.9
switch highway=footway|pedestrian|living_street|residential 1.0
switch highway=tertiary|tertiary_link|bridleway|cycleway 1.1
switch highway=secondary|secondary_link 1.2
switch highway=primary|primary_link 1.3
1.5
#track types
#---------------------------
assign fav_tracktype
switch highway=track|service|path|unclassified #only tags where tracktype has a meaning
switch tracktype=grade1 1.0
switch tracktype=grade2 1.1
switch tracktype=grade3 1.2
switch tracktype=grade4 1.3
switch tracktype=grade5 1.4
1.3
1.0
#smoothness types (worst ones are already forbidden)
#---------------------------
assign fav_smoothness
switch smoothness=excellent|very_good|good|intermediate 1.0
switch smoothness=bad 1.1
switch smoothness=very_bad 1.3
switch and smoothness= highway=footway|pedestrian|living_street|residential 1.0
switch and smoothness= highway=tertiary|tertiary_link|cycleway 1.0
switch and smoothness= highway=secondary|secondary_link 1.0
switch and smoothness= highway=primary|primary_link 1.0
switch and smoothness= highway=unclassified|service 1.1
switch and smoothness= highway=path|bridleway 1.6
switch and smoothness= highway=track 1.6
1.8
#cycle routes (we want a small bonus if it's one)
#---------------------------
#icn=international, ncn=national, rcn=regional, lcn=local
assign fav_cycleroute
switch or route_bicycle_icn=yes
or route_bicycle_ncn=yes
or route_bicycle_rcn=yes
route_bicycle_lcn=yes 0.8
1.0
#hiking routes (we want a small malus if it's one and option was ticked)
#---------------------------
#walking network
assign unfav_hiking
switch avoid_hiking
switch or route_hiking_iwn=yes
or route_hiking_nwn=yes
or route_hiking_rwn=yes
or route_hiking_lwn=yes
route_hiking_=yes 1.1
1.0
1.0
#oneway (we want to avoid taking one way streets in opposite direction if it's cheap to avoid it)
#---------------------------
assign avoid_oneway
switch and reversedirection=yes and oneway=yes oneway:bicycle=no 1.2 1.0
#we allow to dismount the bike with a penalty
#---------------------------
assign dismount_penalty
switch bicycle=dismount 1.2 1.0
#avoid highspeed roads (highest ones already forbidden)
#---------------------------
assign fav_lowspeed
switch maxspeed=20|30 1.0
switch maxspeed=40|50 1.1
switch maxspeed=60|70 1.3
switch maxspeed=80|90 1.5
switch and maxspeed= highway=tertiary|tertiary_link 1.3
switch and maxspeed= highway=primary|primary_link|secondary|secondary_link 1.5
1.0
#avoid riding next to highspeed roads
#---------------------------
assign noise_penalty
switch estimated_noise_class=1 0.8
switch estimated_noise_class=2 0.9
switch estimated_noise_class=3 1.0
switch estimated_noise_class=4 1.1
switch estimated_noise_class=5 1.2
switch estimated_noise_class=6 1.4
1.0
#we want forest!
#---------------------------
assign no_forest_penalty
switch estimated_forest_class=1 1.3
switch estimated_forest_class=2 1.2
switch estimated_forest_class=3 1.1
switch estimated_forest_class=4 1.0
switch estimated_forest_class=5 0.9
switch estimated_forest_class=6 0.8
1.0
#we want rivers and canals!
#---------------------------
assign no_river_penalty
switch estimated_river_class=1 1.3
switch estimated_river_class=2 1.2
switch estimated_river_class=3 1.1
switch estimated_river_class=4 1.0
switch estimated_river_class=5 0.9
switch estimated_river_class=6 0.8
1.0
#we don't want huge traffic
#---------------------------
assign no_traffic_penalty
switch estimated_traffic_class=1 0.8
switch estimated_traffic_class=2 0.9
switch estimated_traffic_class=3 1.0
switch estimated_traffic_class=4 1.1
switch estimated_traffic_class=5 1.2
switch estimated_traffic_class=6 1.4
1.0
#forbidden ways (costfactor>=10000)
#---------------------------
assign bad_sac_scale
sac_scale=difficult_alpine_hiking|demanding_alpine_hiking|alpine_hiking|demanding_mountain_hiking|mountain_hiking|hiking
assign forbidden
#bad_paths
switch and highway=path smoothness=impassable|very_horrible|horrible 10000
switch and highway=path bad_sac_scale 10000
switch and highway=path or mtb:scale=2|2+|2-|3|4|5|6 mtb:scale:uphill=2|3|4|5 10000
switch and highway=path|footway|cycleway|bridleway trail_visibility=bad|horrible|no 10000
switch and highway=path|track and smoothness= and surface= and mtb:scale= and tracktype= not bicycle=yes|permissive|designated|dismount 10000
switch and highway=path|track obstacle=vegetation 10000
switch and highway=path|track and tracktype=grade4|grade5 and smoothness= and surface= mtb:scale= 10000
#bad_oneway
switch and reversedirection=yes and oneway=yes not oneway:bicycle=no 10000
switch and reversedirection=yes junction=roundabout|circular 10000
#bad_highway
switch and highway=footway|bridleway|pedestrian not bicycle=yes|permissive|designated|dismount 10000
switch highway=motorway|trunk|motorway_link|trunk_link|raceway|corridor 10000
switch bicycle=no 10000
switch toll=yes 10000
#no_access
switch and access=no|private|customers not bicycle=yes|permissive|designated|dismount 10000
switch railway=rail 10000
#no_water
switch waterway=river|canal|fairway 10000
switch route=ferry 10000
switch boat=yes 10000
#high_maxspeed
switch maxspeed=130|120|110 10000
0
assign costfactor
add
multiply fav_surface
multiply fav_highway
multiply fav_cycleroute
multiply avoid_oneway
multiply dismount_penalty
multiply fav_tracktype
multiply fav_smoothness
multiply unfav_hiking
multiply fav_lowspeed
multiply noise_penalty
multiply no_forest_penalty
multiply no_river_penalty
no_traffic_penalty
forbidden
---context:node # following code refers to node tags
#Forbidden nodes=>initialcost values>= 1000000
#forbidden nodes
#---------------------------
assign no_access
switch and access=no|private not or bicycle=yes|permissive|designated|dismount foot=yes 1000000
switch bicycle=no 1000000
0
#barriers
#---------------------------
assign barrierpenalty
switch barrier=swing_gate|motorcycle_barrier|block|bollard|cycle_barrier|kissing_gate|kerb 1
switch barrier=gate|lift_gate switch
safe_gate 1000000 1
0
assign initialcost 0
assign initialcost
add initialcost
add barrierpenalty
no_access