-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaterway.brf
248 lines (213 loc) · 8.77 KB
/
waterway.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
---model:btools.router.WaterwayModel
---context:global # following code refers to global config
assign validForBoat 1
assign waypointCatchingRange 1250 # find waypoint in range
# my boat in meter
assign boat_height 2.5 # %boat_height% | Boat height in Meter | number
assign boat_width 2.2 # %boat_width% | Boat width in Meter | number
assign boat_length 10.0 # Boat length in Meter | (not used now)
assign boat_draft 1.2 # %boat_draft% | Boat draft in Meter | number
assign literHour 1.0 # %literHour% | liter per hour | number
# my boat has max speed
assign maxSpeed 999 # km/h (Caution: this is case sensitive internal parameter and different to maxspeed)
# handle with care, this belongs to your local area and your boat
assign speed_normal 10 # %speed_normal% | Speed in kmh | number
assign flow_rate 0 # %flow_rate% | Flow on a river in kmh | number
assign shortest_way 0 # %shortest_way% | find the direct way | boolean
assign useCEMTonly 0 # %useCEMTonly% | use only CEMT or motorboat=yes, exclude unmarked waterways | boolean
assign processUnusedTags 1 # lists all (incl. unused) key/value pairs in geojson
assign cost1speed 20 # kmh
assign showspeed 1 # show speed instead of elevation (geojson)
# Turn instructions settings
assign turnInstructionMode 4 # Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style]
assign inverseRouting 0 #
assign turnInstructionCatchingRange 40 # 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 false # Set to "false" to avoid generating special turning instructions for roundabouts | boolean
assign waiting_lock 900 # in seconds, for one lock_gate
assign waiting_bridge 900 # in seconds
assign around_time 900 # in seconds, avoid obstacles
assign notdefined 100000
---context:way # following code refers to way-tags
assign turncost 0
assign initialcost 0
assign not_used
switch access=no true
switch access=private true
switch boat=no|private true
switch motorboat=no|private true
switch disused=yes true
switch disused:lock=yes true
switch disused:waterway=yes true
switch disused:waterway=lock true
switch and CEMT= and motorboat= and boat= ship= true
false
assign no_depth
switch and not depth=
lesser v:depth boat_draft true
switch and not maxdraft=
lesser v:maxdraft boat_draft true
switch and not draft=
lesser v:draft boat_draft true
switch and not maxdraught=
lesser v:maxdraught boat_draft true
switch and not mindepth=
lesser v:mindepth boat_draft true
switch and not waterway:mindepth=
lesser v:waterway:mindepth boat_draft true
switch and not seamark:fairway:minimum_depth=
lesser v:seamark:fairway:minimum_depth boat_draft true
false
assign no_width
switch and not seamark:bridge:clearance_width=
lesser v:seamark:bridge:clearance_width boat_width true
switch and not seamark:gate:clearance_width=
lesser v:seamark:gate:clearance_width boat_width true
switch and not width=
lesser v:width boat_width true
switch and not maxwidth=
lesser v:maxwidth boat_width true
false
assign no_height
switch and not maxheight=
lesser v:maxheight boat_height true
switch and not seamark:gate:clearance_height=
lesser v:seamark:gate:clearance_height boat_height true
false
assign use_CEMT
if not CEMT= then (
switch motorboat=no false
switch ship=no false
switch CEMT=0|I|II|III|IV|V|Va|Vb|VI|VIa|VIb|VIc|VII true # make sure to drop classes you can't use
false
)
else
switch and not waterway= motorboat=yes true
false
assign boat_maxspeed =
if ( and waterway=river reversedirection=yes ) then sub speed_normal flow_rate
else if ( waterway=river ) then add speed_normal flow_rate
else speed_normal
assign maxspeed_impl =
switch CEMT=0 notdefined
switch CEMT=I|II|III|IV notdefined
switch CEMT=V|Va|Vb notdefined
switch CEMT=VI|VIa|VIb|VIc|VII notdefined
notdefined
assign maxspeed_expl =
if not maxspeed= then (
switch maxspeed=4.5 4.5
switch maxspeed=5 5
switch maxspeed=6 6
switch maxspeed=7 7
switch maxspeed=8 8
switch maxspeed=9 9
switch maxspeed=10 10
switch maxspeed=12 12
switch maxspeed=13 13
switch maxspeed=13.5 13.5
switch maxspeed=15 15
switch maxspeed=16 16
switch maxspeed=20 20
switch maxspeed=25 25
notdefined
)
else
switch waterway:maxspeed= notdefined
v:waterway:maxspeed
assign maxspeed_defined
switch lesser maxspeed_expl notdefined maxspeed_expl maxspeed_impl
assign maxspeed =
min maxspeed_defined boat_maxspeed
assign is_oneway
switch not oneway=
switch and reversedirection=yes
oneway=yes|true|1
1
0
0
assign costfactor
if and not waterway= is_oneway then notdefined
else if and use_CEMT
and not no_depth
and not no_width
and not no_height
not not_used then (
1
)
else
(
if waterway= then notdefined
else if not_used then notdefined
else if no_depth then notdefined
else if no_width then notdefined
else if no_height then notdefined
else if not useCEMTonly then (
switch waterway=canal|river|fairway|safe_water 1
switch seamark:type=fairway|recommended_track 1
# switch not whitewater= 1
# switch motorboat=yes 1
# switch boat=yes 1
# switch ship=yes 1
notdefined
)
else
notdefined
)
---context:node # following code refers to node tags
assign free_height
if seamark:bridge:category=opening then
switch and not seamark:bridge:clearance_height_closed=
greater v:seamark:bridge:clearance_height_closed boat_height true
false
else false
assign waiting_height
if seamark:bridge:category=opening then
switch and not seamark:bridge:clearance_height_closed=
lesser v:seamark:bridge:clearance_height_closed boat_height true
switch and not seamark:bridge:clearance_height=
lesser v:seamark:bridge:clearance_height boat_height true
false
else false
assign no_height
if seamark:bridge:category=opening then
switch and not seamark:bridge:clearance_height_open=
lesser v:seamark:bridge:clearance_height_open boat_height true
false
else if seamark:bridge:category=fixed then
switch and not seamark:bridge:clearance_height=
lesser v:seamark:bridge:clearance_height boat_height true
# switch and not maxheight=
# lesser v:maxheight boat_height true
# switch and not seamark:bridge:clearance_height_safe=
# lesser v:seamark:bridge:clearance_height_safe boat_height true
false
else if seamark:type=cable_overhead then
switch and not seamark:cable_overhead:clearance_height=
lesser v:seamark:cable_overhead:clearance_height boat_height true
switch and not seamark:cable_overhead:clearance_height_safe=
lesser v:seamark:cable_overhead:clearance_height_safe boat_height true
false
else
false
assign no_width
switch and not seamark:bridge:clearance_width=
lesser v:seamark:bridge:clearance_width boat_width true
false
assign no_depth
switch and not depth=
lesser v:depth boat_draft true
switch and not maxdraft=
lesser v:maxdraft boat_draft true
switch and not water:depth=
lesser v:water:depth boat_draft true
switch and not waterway:mindepth=
lesser v:waterway:mindepth boat_draft true
false
assign initialcost
switch waterway=weir notdefined
switch no_width notdefined
switch no_height notdefined
switch no_depth notdefined
switch waiting_height waiting_bridge
switch waterway=lock_gate waiting_lock
1