-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvancycling.brf
135 lines (118 loc) · 4.66 KB
/
vancycling.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
---context:global
assign validForBikes = true
assign processUnusedTags = false # %processUnusedTags% | Set true to output unused tags in data tab | boolean
---context:way
assign impracticality_penalty =
if (
or highway=proposed|abandoned|motorway|motorway_link
or motorroad=yes
or access=private|no
or vehicle=private|no
( and ( not route=ferry ) highway= )
) then 99999
else 0
assign pedestrian_penalty =
switch highway=steps 50
switch bicycle=no 10
switch bicycle=dismount 10
switch and highway=footway
estimated_forest_class=6|5 1
switch highway=footway 10
0
# Avoid shared lanes, painted gutters and alleys
# Adjust based on:
# - Haro & Bidwell to Safeway on Robson (should prefer Denman St)
# https://brouter.de/brouter-web/#map=18/49.29034/-123.13538/standard&lonlats=-123.134674,49.289597;-123.135149,49.291143
# - Harbourside to Myodetox (should prefer Seawall over Pender St)
# https://brouter.de/brouter-web/#map=15/49.2839/-123.1152/standard&lonlats=-123.126554,49.289797;-123.097232,49.278785
# - Cambie St to Alexander St (should not take Blood Alley)
# https://www.brouter.de/brouter-web/#map=17/49.28322/-123.10792/standard,Waymarked_Trails-Cycling&lonlats=-123.126527,49.289796;-123.126527,49.289796;-123.095911,49.28404
assign safety_penalty =
switch highway=cycleway|footway 0
switch highway=residential|living_street 0.25
switch cycleway=shared_lane 0.30
switch highway=tertiary|tertiary_link 1.50
switch highway=secondary|secondary_link 3.00
switch highway=service 3.50
switch highway=primary|primary_link 5.00
switch highway=trunk 5.00
10
# Avoid reversing one ways
# Adjust based on:
# - Carrall St to Alexander St (should reverse a tiny bit)
# https://www.brouter.de/brouter-web/#map=16/49.2833/-123.1046/standard,Waymarked_Trails-Cycling&lonlats=-123.126527,49.289796;-123.126527,49.289796;-123.095911,49.28404
assign one_way_penalty =
if (
and reversedirection=yes
and ( not oneway:bicycle=no )
( or oneway:bicycle=yes oneway=yes|true|1 )
)
then 3
else 0
# Tiny cost adjustments for route niceties
assign traffic_penalty
switch estimated_traffic_class=7|6 0.05
switch estimated_traffic_class=5 0.04
switch estimated_traffic_class=4 0.03
switch estimated_traffic_class=3 0.02
switch estimated_traffic_class=1|2 0.01
0.00
assign noise_penalty
switch estimated_noise_class=5|6 0.05
switch estimated_noise_class=4 0.04
switch estimated_noise_class=3 0.03
switch estimated_noise_class=2 0.02
switch estimated_noise_class=1 0.01
0.00
assign no_river_penalty
switch estimated_river_class=6|5 0.00
switch estimated_river_class=4 0.02
switch estimated_river_class=3 0.04
switch estimated_river_class=2 0.06
switch estimated_river_class=1 0.08
0.10
assign no_forest_penalty
switch estimated_forest_class=6|5 0.00
switch estimated_forest_class=4 0.02
switch estimated_forest_class=3 0.04
switch estimated_forest_class=2 0.06
switch estimated_forest_class=1 0.08
0.10
# calculate the cost-factor, which is the factor by which the distance of a
# way-segment is multiplied to calculate the cost of that segment. The
# costfactor must be >=1 and it's supposed to be close to 1 for the type of
# way the routing profile is searching for
assign costfactor
# fixed cost factor for taking the ferry
if route=ferry then 2 else
# penalties to encourage bike paths
add impracticality_penalty
add pedestrian_penalty
# penalties to encourage really nice bike paths
add safety_penalty
add no_river_penalty
add noise_penalty
add traffic_penalty
add one_way_penalty
add no_forest_penalty
1
---context:node # following code refers to node tags
assign defaultaccess =
if ( access= ) then true
else if ( access=private|no ) then false
else true
assign bike_access =
if nodeaccessgranted=yes then true
else if bicycle= then
(
if vehicle= then defaultaccess
else not vehicle=private|no
)
else not bicycle=private|no|dismount
assign footaccess =
if bicycle=dismount then true
else if foot= then defaultaccess
else not foot=private|no
assign initialcost =
if bike_access then 0
else ( if footaccess then 10 else 1000000 )