Merge car-{fast,eco} and fastbike-asia-pacific variants with car-vario and fastbike profiles with configurable variables
This commit is contained in:
parent
a7d26d70ef
commit
815028e961
5 changed files with 39 additions and 781 deletions
|
@ -1,271 +0,0 @@
|
|||
#
|
||||
# Car-Routing based on a kinematic model
|
||||
#
|
||||
# Depending on the vmax-parameter (target-speed)
|
||||
# this can be anything from least-time routing to eco-routing
|
||||
#
|
||||
#
|
||||
---model:btools.router.KinematicModel
|
||||
|
||||
---context:global
|
||||
|
||||
# kinematic parameters
|
||||
|
||||
assign vmax = 90 # kmh
|
||||
assign recup_efficiency = 0.7 # (ratio)
|
||||
assign totalweight = 1640 # kg
|
||||
assign f_roll = 232 # Newton
|
||||
assign f_air = 0.4 # 0.5*cw*A*rho
|
||||
assign f_recup = 400 # Newton
|
||||
assign p_standby = 250 # Watt
|
||||
|
||||
# technical parameters
|
||||
|
||||
assign validForCars = true
|
||||
assign pass1coefficient = 1.3
|
||||
assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
|
||||
|
||||
assign avoid_toll = false # %avoid_toll% | Avoid paid roads | boolean
|
||||
assign avoid_unpaved = false # %avoid_unpaved% | Avoid unpaved roads, if possible | boolean
|
||||
assign avoid_motorways = false # %avoid_motorways% | Avoid motorways | boolean
|
||||
|
||||
|
||||
# classifier constants
|
||||
|
||||
assign classifier_none = 1
|
||||
assign classifier_ferry = 2
|
||||
|
||||
|
||||
---context:way # following code refers to way-tags
|
||||
|
||||
assign is_avoided_toll_road and avoid_toll toll=yes
|
||||
assign is_avoided_motorway and avoid_motorways highway=motorway|motorway_link
|
||||
|
||||
|
||||
#
|
||||
# calculate logical car access
|
||||
#
|
||||
assign isresidentialorliving = or highway=residential|living_street living_street=yes
|
||||
|
||||
assign caraccess
|
||||
switch motorcar=
|
||||
switch motor_vehicle=
|
||||
switch vehicle=
|
||||
switch access=
|
||||
switch highway=motorway|motorway_link 1
|
||||
switch highway=trunk|trunk_link 1
|
||||
switch highway=primary|primary_link 1
|
||||
switch highway=secondary|secondary_link 1
|
||||
switch highway=tertiary|tertiary_link 1
|
||||
switch highway=unclassified 1
|
||||
switch route=ferry 1
|
||||
switch isresidentialorliving 1
|
||||
switch highway=service 1
|
||||
0
|
||||
access=yes|permissive|designated|destination
|
||||
vehicle=yes|designated|destination
|
||||
motor_vehicle=yes|permissive|designated|destination
|
||||
motorcar=yes|permissive|designated|destination
|
||||
|
||||
assign caraccess_destination
|
||||
switch motorcar=
|
||||
switch motor_vehicle=
|
||||
switch vehicle=
|
||||
access=destination
|
||||
vehicle=destination
|
||||
motor_vehicle=destination
|
||||
motorcar=destination
|
||||
|
||||
#
|
||||
# for any change in initialclassifier, initialcost is added once
|
||||
#
|
||||
assign initialclassifier =
|
||||
if route=ferry then classifier_ferry
|
||||
else classifier_none
|
||||
|
||||
|
||||
#
|
||||
# calculate the initial cost
|
||||
# this is added to the total cost each time the costfactor
|
||||
# changed
|
||||
#
|
||||
assign initialcost =
|
||||
if ( equal initialclassifier classifier_ferry ) then 10000
|
||||
else 0
|
||||
|
||||
assign accessspeedlimit = if caraccess then 999 else 0
|
||||
|
||||
assign isbadoneway = if reversedirection=yes then ( if oneway= then junction=roundabout else oneway=yes|true|1 ) else oneway=-1
|
||||
assign onewayspeedlimit = if isbadoneway then 0 else 999
|
||||
|
||||
assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link
|
||||
|
||||
assign maxspeed_surface =
|
||||
switch or surface= surface=paved|asphalt|concrete 999
|
||||
switch surface=paving_stones|cobblestone|sett 30
|
||||
switch surface=fine_gravel ( switch avoid_unpaved 3 10 )
|
||||
switch avoid_unpaved 1 2
|
||||
|
||||
assign maxspeed_tracktype =
|
||||
switch tracktype= 999
|
||||
switch tracktype=grade1 40
|
||||
switch tracktype=grade2 ( switch avoid_unpaved 2 5 )
|
||||
1
|
||||
|
||||
assign maxspeed_implicit =
|
||||
switch highway=motorway 999
|
||||
switch highway=motorway_link 130
|
||||
switch highway=trunk 250
|
||||
switch highway=trunk_link 100
|
||||
switch highway=primary|primary_link 100
|
||||
switch highway=secondary|secondary_link 90
|
||||
switch highway=tertiary|tertiary_link 80
|
||||
switch highway=unclassified 50
|
||||
switch route=ferry 10
|
||||
switch highway=bridleway 10
|
||||
switch isresidentialorliving 30
|
||||
switch highway=service 30
|
||||
switch highway=track|road|path switch tracktype=grade1 30 5
|
||||
0
|
||||
|
||||
assign maxspeed_forward =
|
||||
switch maxspeed:forward=50 50
|
||||
switch maxspeed:forward=30 30
|
||||
switch maxspeed:forward=10 10
|
||||
switch maxspeed:forward=20 20
|
||||
switch maxspeed:forward=40 40
|
||||
switch maxspeed:forward=60 60
|
||||
switch maxspeed:forward=70 70
|
||||
switch maxspeed:forward=80 80
|
||||
switch maxspeed:forward=90 90
|
||||
switch maxspeed:forward=100 100
|
||||
switch maxspeed:forward=110 110
|
||||
switch maxspeed:forward=120 120
|
||||
switch maxspeed:forward=130 130
|
||||
switch maxspeed:forward=urban 50
|
||||
switch maxspeed:forward=rural 100
|
||||
999
|
||||
|
||||
assign maxspeed_backward =
|
||||
switch maxspeed:backward=50 50
|
||||
switch maxspeed:backward=30 30
|
||||
switch maxspeed:backward=10 10
|
||||
switch maxspeed:backward=20 20
|
||||
switch maxspeed:backward=40 40
|
||||
switch maxspeed:backward=60 60
|
||||
switch maxspeed:backward=70 70
|
||||
switch maxspeed:backward=80 80
|
||||
switch maxspeed:backward=90 90
|
||||
switch maxspeed:backward=100 100
|
||||
switch maxspeed:backward=110 110
|
||||
switch maxspeed:backward=120 120
|
||||
switch maxspeed:backward=130 130
|
||||
switch maxspeed:backward=urban 50
|
||||
switch maxspeed:backward=rural 100
|
||||
999
|
||||
|
||||
assign maxspeed_explicit =
|
||||
switch maxspeed=50 50
|
||||
switch maxspeed=30 30
|
||||
switch maxspeed=10 10
|
||||
switch maxspeed=20 20
|
||||
switch maxspeed=40 40
|
||||
switch maxspeed=60 60
|
||||
switch maxspeed=70 70
|
||||
switch maxspeed=80 80
|
||||
switch maxspeed=90 90
|
||||
switch maxspeed=100 100
|
||||
switch maxspeed=110 110
|
||||
switch maxspeed=120 120
|
||||
switch maxspeed=130 130
|
||||
switch maxspeed=urban 50
|
||||
switch maxspeed=rural 100
|
||||
if reversedirection=yes then maxspeed_backward else maxspeed_forward
|
||||
|
||||
assign maxspeed =
|
||||
min if is_avoided_toll_road then 0 else 999
|
||||
min if is_avoided_motorway then 0 else 999
|
||||
min onewayspeedlimit
|
||||
min accessspeedlimit
|
||||
min maxspeed_explicit
|
||||
min maxspeed_implicit
|
||||
min maxspeed_surface maxspeed_tracktype
|
||||
|
||||
assign costfactor = if equal maxspeed 0 then 10000 else 0
|
||||
|
||||
assign minspeed =
|
||||
switch highway=motorway|motorway_link|trunk 75 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=track ) then if tracktype=grade1 then 4 else 2
|
||||
else if ( highway=bridleway|road ) then 2
|
||||
else 0
|
||||
|
||||
# some more classifying bits used for voice hint generation...
|
||||
|
||||
assign isgoodoneway = if reversedirection=yes then oneway=-1
|
||||
else if oneway= then junction=roundabout else oneway=yes|true|1
|
||||
assign isroundabout = junction=roundabout
|
||||
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
|
||||
add multiply isgoodforcars 16
|
||||
add multiply isresidentialorliving 32
|
||||
multiply caraccess_destination 64
|
||||
|
||||
---context:node # following code refers to node tags
|
||||
|
||||
#
|
||||
# calculate logical car access to nodes
|
||||
#
|
||||
assign caraccess
|
||||
switch motorcar=
|
||||
switch motor_vehicle=
|
||||
switch vehicle=
|
||||
switch access=
|
||||
not barrier=gate|bollard|lift_gate|cycle_barrier
|
||||
access=yes|permissive|designated|destination
|
||||
vehicle=yes|permissive|designated|destination
|
||||
motor_vehicle=yes|permissive|designated|destination
|
||||
motorcar=yes|permissive|designated|destination
|
||||
|
||||
assign initialcost =
|
||||
switch and avoid_toll barrier=toll_booth 1000000
|
||||
switch caraccess
|
||||
0
|
||||
1000000
|
||||
|
||||
assign maxspeed =
|
||||
|
||||
if or crossing=traffic_signals highway=traffic_signals
|
||||
then
|
||||
switch greater way:priorityclassifier 24 5
|
||||
switch greater way:priorityclassifier 22 3
|
||||
switch greater way:priorityclassifier 20 1
|
||||
0
|
||||
else if railway=level_crossing then 0
|
||||
else 999
|
|
@ -1,271 +0,0 @@
|
|||
#
|
||||
# Car-Routing based on a kinematic model
|
||||
#
|
||||
# Depending on the vmax-parameter (target-speed)
|
||||
# this can be anything from least-time routing to eco-routing
|
||||
#
|
||||
#
|
||||
---model:btools.router.KinematicModel
|
||||
|
||||
---context:global
|
||||
|
||||
# kinematic parameters
|
||||
|
||||
assign vmax = 160 # kmh
|
||||
assign recup_efficiency = 0.7 # (ratio)
|
||||
assign totalweight = 1640 # kg
|
||||
assign f_roll = 232 # Newton
|
||||
assign f_air = 0.4 # 0.5*cw*A*rho
|
||||
assign f_recup = 400 # Newton
|
||||
assign p_standby = 250 # Watt
|
||||
|
||||
# technical parameters
|
||||
|
||||
assign validForCars = true
|
||||
assign pass1coefficient = 1.3
|
||||
assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
|
||||
|
||||
assign avoid_toll = false # %avoid_toll% | Avoid paid roads | boolean
|
||||
assign avoid_unpaved = false # %avoid_unpaved% | Avoid unpaved roads, if possible | boolean
|
||||
assign avoid_motorways = false # %avoid_motorways% | Avoid motorways | boolean
|
||||
|
||||
|
||||
# classifier constants
|
||||
|
||||
assign classifier_none = 1
|
||||
assign classifier_ferry = 2
|
||||
|
||||
|
||||
---context:way # following code refers to way-tags
|
||||
|
||||
assign is_avoided_toll_road and avoid_toll toll=yes
|
||||
assign is_avoided_motorway and avoid_motorways highway=motorway|motorway_link
|
||||
|
||||
|
||||
#
|
||||
# calculate logical car access
|
||||
#
|
||||
assign isresidentialorliving = or highway=residential|living_street living_street=yes
|
||||
|
||||
assign caraccess
|
||||
switch motorcar=
|
||||
switch motor_vehicle=
|
||||
switch vehicle=
|
||||
switch access=
|
||||
switch highway=motorway|motorway_link 1
|
||||
switch highway=trunk|trunk_link 1
|
||||
switch highway=primary|primary_link 1
|
||||
switch highway=secondary|secondary_link 1
|
||||
switch highway=tertiary|tertiary_link 1
|
||||
switch highway=unclassified 1
|
||||
switch route=ferry 1
|
||||
switch isresidentialorliving 1
|
||||
switch highway=service 1
|
||||
0
|
||||
access=yes|permissive|designated|destination
|
||||
vehicle=yes|designated|destination
|
||||
motor_vehicle=yes|permissive|designated|destination
|
||||
motorcar=yes|permissive|designated|destination
|
||||
|
||||
assign caraccess_destination
|
||||
switch motorcar=
|
||||
switch motor_vehicle=
|
||||
switch vehicle=
|
||||
access=destination
|
||||
vehicle=destination
|
||||
motor_vehicle=destination
|
||||
motorcar=destination
|
||||
|
||||
#
|
||||
# for any change in initialclassifier, initialcost is added once
|
||||
#
|
||||
assign initialclassifier =
|
||||
if route=ferry then classifier_ferry
|
||||
else classifier_none
|
||||
|
||||
|
||||
#
|
||||
# calculate the initial cost
|
||||
# this is added to the total cost each time the costfactor
|
||||
# changed
|
||||
#
|
||||
assign initialcost =
|
||||
if ( equal initialclassifier classifier_ferry ) then 10000
|
||||
else 0
|
||||
|
||||
assign accessspeedlimit = if caraccess then 999 else 0
|
||||
|
||||
assign isbadoneway = if reversedirection=yes then ( if oneway= then junction=roundabout else oneway=yes|true|1 ) else oneway=-1
|
||||
assign onewayspeedlimit = if isbadoneway then 0 else 999
|
||||
|
||||
assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link
|
||||
|
||||
assign maxspeed_surface =
|
||||
switch or surface= surface=paved|asphalt|concrete 999
|
||||
switch surface=paving_stones|cobblestone|sett 30
|
||||
switch surface=fine_gravel ( switch avoid_unpaved 3 10 )
|
||||
switch avoid_unpaved 1 2
|
||||
|
||||
assign maxspeed_tracktype =
|
||||
switch tracktype= 999
|
||||
switch tracktype=grade1 40
|
||||
switch tracktype=grade2 ( switch avoid_unpaved 2 5 )
|
||||
1
|
||||
|
||||
assign maxspeed_implicit =
|
||||
switch highway=motorway 999
|
||||
switch highway=motorway_link 130
|
||||
switch highway=trunk 250
|
||||
switch highway=trunk_link 100
|
||||
switch highway=primary|primary_link 100
|
||||
switch highway=secondary|secondary_link 90
|
||||
switch highway=tertiary|tertiary_link 80
|
||||
switch highway=unclassified 50
|
||||
switch route=ferry 10
|
||||
switch highway=bridleway 10
|
||||
switch isresidentialorliving 30
|
||||
switch highway=service 30
|
||||
switch highway=track|road|path switch tracktype=grade1 30 5
|
||||
0
|
||||
|
||||
assign maxspeed_forward =
|
||||
switch maxspeed:forward=50 50
|
||||
switch maxspeed:forward=30 30
|
||||
switch maxspeed:forward=10 10
|
||||
switch maxspeed:forward=20 20
|
||||
switch maxspeed:forward=40 40
|
||||
switch maxspeed:forward=60 60
|
||||
switch maxspeed:forward=70 70
|
||||
switch maxspeed:forward=80 80
|
||||
switch maxspeed:forward=90 90
|
||||
switch maxspeed:forward=100 100
|
||||
switch maxspeed:forward=110 110
|
||||
switch maxspeed:forward=120 120
|
||||
switch maxspeed:forward=130 130
|
||||
switch maxspeed:forward=urban 50
|
||||
switch maxspeed:forward=rural 100
|
||||
999
|
||||
|
||||
assign maxspeed_backward =
|
||||
switch maxspeed:backward=50 50
|
||||
switch maxspeed:backward=30 30
|
||||
switch maxspeed:backward=10 10
|
||||
switch maxspeed:backward=20 20
|
||||
switch maxspeed:backward=40 40
|
||||
switch maxspeed:backward=60 60
|
||||
switch maxspeed:backward=70 70
|
||||
switch maxspeed:backward=80 80
|
||||
switch maxspeed:backward=90 90
|
||||
switch maxspeed:backward=100 100
|
||||
switch maxspeed:backward=110 110
|
||||
switch maxspeed:backward=120 120
|
||||
switch maxspeed:backward=130 130
|
||||
switch maxspeed:backward=urban 50
|
||||
switch maxspeed:backward=rural 100
|
||||
999
|
||||
|
||||
assign maxspeed_explicit =
|
||||
switch maxspeed=50 50
|
||||
switch maxspeed=30 30
|
||||
switch maxspeed=10 10
|
||||
switch maxspeed=20 20
|
||||
switch maxspeed=40 40
|
||||
switch maxspeed=60 60
|
||||
switch maxspeed=70 70
|
||||
switch maxspeed=80 80
|
||||
switch maxspeed=90 90
|
||||
switch maxspeed=100 100
|
||||
switch maxspeed=110 110
|
||||
switch maxspeed=120 120
|
||||
switch maxspeed=130 130
|
||||
switch maxspeed=urban 50
|
||||
switch maxspeed=rural 100
|
||||
if reversedirection=yes then maxspeed_backward else maxspeed_forward
|
||||
|
||||
assign maxspeed =
|
||||
min if is_avoided_toll_road then 0 else 999
|
||||
min if is_avoided_motorway then 0 else 999
|
||||
min onewayspeedlimit
|
||||
min accessspeedlimit
|
||||
min maxspeed_explicit
|
||||
min maxspeed_implicit
|
||||
min maxspeed_surface maxspeed_tracktype
|
||||
|
||||
assign costfactor = if equal maxspeed 0 then 10000 else 0
|
||||
|
||||
assign minspeed =
|
||||
switch highway=motorway|motorway_link|trunk 75 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=track ) then if tracktype=grade1 then 4 else 2
|
||||
else if ( highway=bridleway|road ) then 2
|
||||
else 0
|
||||
|
||||
# some more classifying bits used for voice hint generation...
|
||||
|
||||
assign isgoodoneway = if reversedirection=yes then oneway=-1
|
||||
else if oneway= then junction=roundabout else oneway=yes|true|1
|
||||
assign isroundabout = junction=roundabout
|
||||
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
|
||||
add multiply isgoodforcars 16
|
||||
add multiply isresidentialorliving 32
|
||||
multiply caraccess_destination 64
|
||||
|
||||
---context:node # following code refers to node tags
|
||||
|
||||
#
|
||||
# calculate logical car access to nodes
|
||||
#
|
||||
assign caraccess
|
||||
switch motorcar=
|
||||
switch motor_vehicle=
|
||||
switch vehicle=
|
||||
switch access=
|
||||
not barrier=gate|bollard|lift_gate|cycle_barrier
|
||||
access=yes|permissive|designated|destination
|
||||
vehicle=yes|permissive|designated|destination
|
||||
motor_vehicle=yes|permissive|designated|destination
|
||||
motorcar=yes|permissive|designated|destination
|
||||
|
||||
assign initialcost =
|
||||
switch and avoid_toll barrier=toll_booth 1000000
|
||||
switch caraccess
|
||||
0
|
||||
1000000
|
||||
|
||||
assign maxspeed =
|
||||
|
||||
if or crossing=traffic_signals highway=traffic_signals
|
||||
then
|
||||
switch greater way:priorityclassifier 24 5
|
||||
switch greater way:priorityclassifier 22 3
|
||||
switch greater way:priorityclassifier 20 1
|
||||
0
|
||||
else if railway=level_crossing then 0
|
||||
else 999
|
|
@ -1,226 +0,0 @@
|
|||
#
|
||||
# A variant of fastbike with a slightly different treatment
|
||||
# of trunks and motorway-bike-access. This seems to be more
|
||||
# suitable for some countries like Japan or Australia
|
||||
#
|
||||
# In standard fastbike (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 version here has more formal access rules.
|
||||
|
||||
---context:global # following code refers to global config
|
||||
|
||||
# Use the following switches to change behaviour
|
||||
# (1=yes, 0=no):
|
||||
|
||||
assign consider_elevation 1 # set to 0 to ignore elevation in routing
|
||||
assign allow_steps 1 # set to 0 to disallow steps
|
||||
assign allow_ferries 1 # set to 0 to disallow ferries
|
||||
assign ignore_cycleroutes 0 # set to 1 for better elevation results
|
||||
assign stick_to_cycleroutes 0 # set to 1 to just follow cycleroutes
|
||||
assign avoid_unsafe 0 # set to 1 to avoid standard highways
|
||||
assign turnInstructionMode 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
|
||||
|
||||
assign validForBikes 1
|
||||
|
||||
# the elevation parameters
|
||||
|
||||
assign downhillcost switch consider_elevation 60 0
|
||||
assign downhillcutoff 1.5
|
||||
assign uphillcost 0
|
||||
assign uphillcutoff 1.5
|
||||
|
||||
---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 90
|
||||
|
||||
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 =
|
||||
if access= then
|
||||
(
|
||||
if motorroad=yes then false
|
||||
else if highway=motorway|motorway_link then false
|
||||
else true
|
||||
)
|
||||
else if access=private|no then false
|
||||
else true
|
||||
#
|
||||
# calculate logical bike access
|
||||
#
|
||||
assign bikeaccess
|
||||
or any_cycleroute
|
||||
switch bicycle=
|
||||
switch bicycle_road=yes
|
||||
1
|
||||
switch vehicle=
|
||||
defaultaccess
|
||||
switch or vehicle=private vehicle=no
|
||||
0
|
||||
1
|
||||
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
|
||||
100000
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
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
|
||||
|
||||
switch or highway=motorway highway=motorway_link 1.5
|
||||
switch or highway=trunk highway=trunk_link 1.5
|
||||
switch or highway=primary highway=primary_link 1.2
|
||||
switch or highway=secondary highway=secondary_link 1.1
|
||||
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.3
|
||||
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
|
||||
|
||||
---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
|
|
@ -5,21 +5,29 @@
|
|||
#
|
||||
# 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
|
||||
|
||||
# Use the following switches to change behaviour
|
||||
# (1=yes, 0=no):
|
||||
|
||||
assign consider_elevation 1 # set to 0 to ignore elevation in routing
|
||||
assign allow_steps 1 # set to 0 to disallow steps
|
||||
assign allow_ferries 1 # set to 0 to disallow ferries
|
||||
assign ignore_cycleroutes 0 # set to 1 for better elevation results
|
||||
assign stick_to_cycleroutes 0 # set to 1 to just follow cycleroutes
|
||||
assign avoid_unsafe 0 # set to 1 to avoid standard highways
|
||||
assign turnInstructionMode 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
|
||||
assign consider_elevation = true # set to false to ignore elevation in routing
|
||||
assign allow_steps = true # set to false to disallow steps
|
||||
assign allow_ferries = true # set to false to disallow ferries
|
||||
assign ignore_cycleroutes = false # set to true for better elevation results
|
||||
assign stick_to_cycleroutes = false # set to true to just follow cycleroutes
|
||||
assign avoid_unsafe = false # set to true to avoid standard highways
|
||||
assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
|
||||
assign allow_motorways = false # set to true to allow motorways
|
||||
|
||||
assign validForBikes 1
|
||||
assign validForBikes = true
|
||||
|
||||
# the elevation parameters
|
||||
|
||||
|
@ -47,10 +55,14 @@ assign initialcost switch route=ferry 10000 0
|
|||
#
|
||||
assign defaultaccess
|
||||
switch access=
|
||||
not motorroad=yes
|
||||
(
|
||||
if motorroad=yes then false
|
||||
else if highway=motorway|motorway_link then false
|
||||
else true
|
||||
)
|
||||
switch or access=private access=no
|
||||
0
|
||||
1
|
||||
false
|
||||
true
|
||||
|
||||
#
|
||||
# calculate logical bike access
|
||||
|
@ -123,8 +135,8 @@ assign costfactor
|
|||
min 9999
|
||||
add max onewaypenalty accesspenalty
|
||||
|
||||
switch or highway=motorway highway=motorway_link 10000
|
||||
switch or highway=trunk highway=trunk_link 10
|
||||
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 1.2
|
||||
switch or highway=secondary highway=secondary_link 1.1
|
||||
switch or highway=tertiary highway=tertiary_link 1.0
|
||||
|
|
14
misc/profiles2/generate_profile_variants.sh
Executable file
14
misc/profiles2/generate_profile_variants.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
# Car variants
|
||||
sed -e "s/^assign[[:space:]]\+vmax.*\(#.*\)/assign vmax = 160 \1/" car-vario.brf > car-fast.brf
|
||||
sed -e "s/^assign[[:space:]]\+vmax.*\(#.*\)/assign vmax = 90 \1/" car-vario.brf > car-eco.brf
|
||||
|
||||
# Fastbike variants
|
||||
sed -e "s/^assign[[:space:]]\+allow_motorways.*\(#.*\)/assign allow_motorways = true \1/" fastbike.brf > fastbike-asia-pacific.brf
|
||||
|
||||
# Trekking variants
|
||||
sed -e "s/^assign[[:space:]]\+ignore_cycleroutes.*\(#.*\)/assign ignore_cycleroutes = true \1/" trekking.brf > trekking-ignore-cr.brf
|
||||
sed -e "s/^assign[[:space:]]\+allow_ferries.*\(#.*\)/assign allow_ferries = false \1/" trekking.brf > trekking-noferries.brf
|
||||
sed -e "s/^assign[[:space:]]\+allow_steps.*\(#.*\)/assign allow_steps = false \1/" trekking.brf > trekking-nosteps.brf
|
||||
sed -e "s/^assign[[:space:]]\+consider_elevation.*\(#.*\)/assign consider_elevation = false \1/" trekking.brf > trekking-steep.brf
|
Loading…
Reference in a new issue