173 lines
6.4 KiB
Text
173 lines
6.4 KiB
Text
#
|
|
# Moped-Routing is experimantal !!!
|
|
#
|
|
# DO NOT USE FOR ACTUAL NAVIGATION
|
|
#
|
|
# Turn restrictions are missing, leading to wrong routes
|
|
#
|
|
|
|
---context:global
|
|
|
|
assign downhillcost 0
|
|
assign downhillcutoff 0
|
|
assign uphillcost 0
|
|
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
|
|
else 90
|
|
|
|
assign initialcost switch route=ferry 20000 0
|
|
|
|
|
|
#
|
|
# calculate logical car access
|
|
#
|
|
assign motorverhicleaccess
|
|
switch motor_vehicle=
|
|
switch vehicle=
|
|
switch access=
|
|
switch or highway=trunk highway=trunk_link 1
|
|
switch or highway=primary highway=primary_link 1
|
|
switch or highway=secondary highway=secondary_link 1
|
|
switch or highway=tertiary highway=tertiary_link 1
|
|
switch highway=unclassified 1
|
|
switch route=ferry 1
|
|
switch or highway=residential highway=living_street 1
|
|
switch highway=service 1
|
|
0
|
|
or access=yes or access=designated access=destination
|
|
or vehicle=yes or vehicle=designated vehicle=destination
|
|
or motor_vehicle=yes or motor_vehicle=designated motor_vehicle=destination
|
|
|
|
assign caraccess
|
|
switch motorcar=
|
|
motorverhicleaccess
|
|
or motorcar=yes or motorcar=designated motorcar=destination
|
|
|
|
assign motorcycleaccess
|
|
switch motorcycle=
|
|
motorverhicleaccess
|
|
or motorcycle=yes or motorcycle=designated motorcycle=destination
|
|
|
|
assign accesspenalty
|
|
switch or caraccess motorcycleaccess
|
|
switch motorroad=yes 10000 0
|
|
10000
|
|
|
|
assign onewaypenalty
|
|
switch switch reversedirection=yes
|
|
switch oneway=
|
|
junction=roundabout
|
|
or oneway=yes or oneway=true oneway=1
|
|
oneway=-1
|
|
10000
|
|
0.0
|
|
|
|
|
|
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
|
|
|
|
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
|
|
switch or highway=secondary highway=secondary_link 1.4
|
|
switch or highway=tertiary highway=tertiary_link 1.3
|
|
switch highway=unclassified 1.2
|
|
switch route=ferry 5.67
|
|
switch highway=bridleway 5
|
|
switch or highway=residential highway=living_street 2
|
|
switch highway=service 2
|
|
switch or highway=track or highway=road highway=path
|
|
switch tracktype=grade1 5
|
|
switch ispaved 5
|
|
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
|
|
|
|
#
|
|
# calculate logical car access to nodes
|
|
#
|
|
assign motorvehicleaccess
|
|
switch motor_vehicle=
|
|
switch vehicle=
|
|
switch access=
|
|
switch barrier=gate 0
|
|
switch barrier=bollard 0
|
|
switch barrier=lift_gate 0
|
|
switch barrier=cycle_barrier 0
|
|
1
|
|
or access=yes or access=designated access=destination
|
|
or vehicle=yes or vehicle=designated vehicle=destination
|
|
or motor_vehicle=yes or motor_vehicle=designated motor_vehicle=destination
|
|
|
|
assign caraccess
|
|
switch motorcar=
|
|
motorvehicleaccess
|
|
or motorcar=yes or motorcar=designated motorcar=destination
|
|
|
|
assign motorcycleaccess
|
|
switch motorcycle=
|
|
motorvehicleaccess
|
|
or motorcycle=yes or motorcycle=designated motorcycle=destination
|
|
|
|
assign initialcost
|
|
switch or caraccess motorcycleaccess
|
|
0
|
|
1000000
|