turninstructions: update profiles

This commit is contained in:
Arndt 2016-05-06 10:23:54 +02:00
parent 9ff455c05a
commit 7cb5e9f377
6 changed files with 489 additions and 54 deletions

View file

@ -16,6 +16,8 @@ assign uphillcutoff 0
assign validForCars 1
assign pass1coefficient 1.3
assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
---context:way # following code refers to way-tags
assign turncost if junction=roundabout then 0 else 200
@ -62,11 +64,15 @@ assign onewaypenalty
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link
assign costfactor
add max onewaypenalty accesspenalty
switch and highway= not route=ferry 100000
add switch islinktype 0.05 0
switch and highway= not route=ferry 10000
switch or highway=motorway highway=motorway_link 1
switch or highway=trunk highway=trunk_link 1
@ -84,6 +90,48 @@ assign costfactor
30
10000
# 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 ( highway=residential|living_street ) 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 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 isgoodforcars = if greater priorityclassifier 6 then true
else if highway=residential|living_street|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
#

View file

@ -0,0 +1,216 @@
#
# 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 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
# 4 to the costfactor (making it at least 5 - you are allowed
# to push your bike)
#
assign oneway
switch oneway=
junction=roundabout
or oneway=yes or oneway=true oneway=1
assign onewaypenalty
switch switch reversedirection=yes oneway oneway=-1
switch or cycleway=opposite or cycleway=opposite_lane or cycleway=opposite_track oneway:bicycle=no 0
switch or highway=primary highway=primary_link 50
switch or highway=secondary highway=secondary_link 30
switch or highway=tertiary highway=tertiary_link 20
6.0
0.0
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 or highway=residential highway=living_street 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 bicycle=designated 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 ( highway=residential|living_street ) then 6
else if ( highway=service ) then 6
else if ( highway=cycleway ) then 6
else if ( bicycle=designated ) 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 highway=residential|living_street|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

View file

@ -17,8 +17,7 @@ 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 forceSecondaryData 1
assign turnInstructionMode 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style
assign validForBikes 1
@ -131,18 +130,19 @@ assign trafficpenalty0 =
else 0
assign trafficpenalty =
if hascycleway then multiply -1 max -0.3 multiply -1 trafficpenalty0
if hascycleway then min 0.3 trafficpenalty0
else trafficpenalty0
assign costfactor
switch and highway= not route=ferry 10000
switch or highway=proposed highway=abandoned 10000
min 9999
add max onewaypenalty accesspenalty
add trafficpenalty
switch and highway= not route=ferry 100000
switch or highway=motorway highway=motorway_link 100000
switch or highway=proposed highway=abandoned 100000
switch or highway=motorway highway=motorway_link 10000
switch or highway=trunk highway=trunk_link 10
switch or highway=primary highway=primary_link 1.2
switch or highway=secondary highway=secondary_link 1.1
@ -165,6 +165,44 @@ assign costfactor
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 ( highway=residential|living_street ) then 6
else if ( highway=service ) then 6
else if ( highway=cycleway ) then 6
else if ( bicycle=designated ) 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 highway=residential|living_street|service then true
else if ( and highway=track tracktype=grade1 ) then true
else false
---context:node # following code refers to node tags
assign defaultaccess

View file

@ -17,6 +17,7 @@ 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
@ -83,7 +84,7 @@ assign accesspenalty
0
switch footaccess
6
100000
10000
#
# handle one-ways. On primary roads, wrong-oneways should
@ -106,12 +107,13 @@ assign onewaypenalty
assign costfactor
switch and highway= not route=ferry 10000
switch or highway=proposed highway=abandoned 10000
min 9999
add max onewaypenalty accesspenalty
switch and highway= not route=ferry 100000
switch or highway=motorway highway=motorway_link 100000
switch or highway=proposed highway=abandoned 100000
switch or highway=motorway highway=motorway_link 10000
switch or highway=trunk highway=trunk_link 10
switch or highway=primary highway=primary_link 1.2
switch or highway=secondary highway=secondary_link 1.1
@ -134,6 +136,53 @@ assign costfactor
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 ( highway=residential|living_street ) then 6
else if ( highway=service ) then 6
else if ( highway=cycleway ) then 6
else if ( bicycle=designated ) 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 highway=residential|living_street|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

View file

@ -16,6 +16,8 @@ assign uphillcutoff 0
assign validForBikes 1
assign validForCars 1
assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
---context:way # following code refers to way-tags
assign turncost = if junction=roundabout then 0
@ -71,11 +73,15 @@ assign onewaypenalty
assign ispaved or surface=paved or surface=asphalt or surface=concrete surface=paving_stones
assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link
assign costfactor
add max onewaypenalty accesspenalty
switch and highway= not route=ferry 100000
add switch islinktype 0.05 0
switch and highway= not route=ferry 10000
switch or highway=trunk highway=trunk_link 1.5
switch or highway=primary highway=primary_link switch maxspeed=30 2.0 switch maxspeed=50 1.5 1.2
@ -92,6 +98,47 @@ assign costfactor
30
10000
# 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 ( highway=residential|living_street ) 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 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 isgoodforcars = if greater priorityclassifier 6 then true
else if highway=residential|living_street|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
#

View file

@ -14,7 +14,7 @@ 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 = 0 # 0=none, 1=gpsies-style, 2=locus-style
assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
assign validForBikes = true
@ -77,28 +77,6 @@ assign initialclassifier =
else classifier_none
assign priorityclassifier =
if ( highway=motorway ) then 101
else if ( highway=motorway_link ) then 100
else if ( highway=trunk ) then 91
else if ( highway=trunk_link ) then 90
else if ( highway=primary ) then 88
else if ( highway=primary_link ) then 87
else if ( highway=secondary ) then 86
else if ( highway=secondary_link ) then 85
else if ( highway=tertiary ) then 84
else if ( highway=tertiary_link ) then 83
else if ( highway=unclassified ) then 82
else if ( highway=residential|living_street ) then 50
else if ( highway=service ) then 40
else if ( highway=cycleway ) then 30
else if ( highway=bridleway ) then 20
else if ( highway=track|road|path|footway ) then 20
else if ( highway=steps ) then 10
else if ( highway=pedestrian ) then 10
else 0
#
# calculate the initial cost
# this is added to the total cost each time the costfactor
@ -145,7 +123,7 @@ assign footaccess =
assign accesspenalty =
if bikeaccess then 0
else if footaccess then 4
else 100000
else 10000
#
# handle one-ways. On primary roads, wrong-oneways should
@ -153,11 +131,13 @@ assign accesspenalty =
# 4 to the costfactor (making it at least 5 - you are allowed
# to push your bike)
#
assign oneway =
if oneway= then junction=roundabout else oneway=yes|true|1
assign badoneway =
if reversedirection=yes then
if oneway= then junction=roundabout else oneway=yes|true|1
else oneway=-1
assign onewaypenalty =
if ( if reversedirection=yes then oneway else oneway=-1 ) then
if ( badoneway ) then
(
if ( cycleway=opposite|opposite_lane|opposite_track ) then 0
else if ( oneway:bicycle=no ) then 0
@ -168,7 +148,6 @@ assign onewaypenalty =
)
else 0.0
#
# calculate the cost-factor, which is the factor
# by which the distance of a way-segment is multiplied
@ -176,19 +155,38 @@ assign onewaypenalty =
# 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 =
assign costfactor
add ( max onewaypenalty accesspenalty )
#
# exclude rivers, rails etc.
#
if ( and highway= not route=ferry ) then 10000
if ( and highway= not route=ferry ) then 100000
#
# exclude motorways and proposed roads
#
else if ( highway=motorway|motorway_link ) then 10000
else if ( highway=proposed|abandoned ) then 10000
#
# all other exclusions below (access, steps, ferries,..)
# should not be deleted by the decoder, to be available
# in voice-hint-processing
#
else min 9999
#
# apply oneway-and access-penalties
#
add max onewaypenalty accesspenalty
#
# steps and ferries are special. Note this is handled
# before the cycleroute-switch, to be able
# to really exlude them be setting cost to infinity
#
else if ( highway=steps ) then ( if allow_steps then 40 else 100000 )
else if ( route=ferry ) then ( if allow_ferries then 5.67 else 100000 )
if ( highway=steps ) then ( if allow_steps then 40 else 10000 )
else if ( route=ferry ) then ( if allow_ferries then 5.67 else 10000 )
#
# handle long-distance cycle-routes.
@ -226,16 +224,10 @@ assign costfactor =
#
else add ( if ( and avoid_unsafe not isbike ) then 2 else 0 )
#
# exclude motorways and proposed roads
#
if ( highway=motorway|motorway_link ) then 100000
else if ( highway=proposed|abandoned ) then 100000
#
# actuals roads are o.k. if we have a bike hint
#
else if ( highway=trunk|trunk_link ) then ( if isbike then 1.5 else 10 )
if ( highway=trunk|trunk_link ) then ( if isbike then 1.5 else 10 )
else if ( highway=primary|primary_link ) then ( if isbike then 1.2 else 3 )
else if ( highway=secondary|secondary_link ) then ( if isbike then 1.1 else 1.6 )
else if ( highway=tertiary|tertiary_link ) then ( if isbike then 1.0 else 1.4 )
@ -247,6 +239,51 @@ assign costfactor =
else 2.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 ( highway=residential|living_street ) then 6
else if ( highway=service ) then 6
else if ( highway=cycleway ) then 6
else if ( bicycle=designated ) 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 highway=residential|living_street|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 =