Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # *** The hiking profile is for safe hiking
- # *** that avoids car traffic, with a preference
- # *** for hiking routes.
- ---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_ferries 0 # set to 0 to disallow ferries
- assign ignore_hikeroutes 0 # set to 1 for better elevation results
- assign stick_to_hikeroutes 0 # set to 1 to just follow hike routes
- assign validForFoot 1
- # the elevation parameters
- assign downhillcost 0
- assign downhillcutoff 1.5
- assign uphillcost switch consider_elevation 3 0 # elevation penalty reduced from 60 to 3
- assign uphillcutoff 1.5
- ---context:way # following code refers to way-tags
- #
- # pre-calculate some logical expressions
- #
- assign any_hikeroute or route_hiking_=yes or route_hiking_iwn=yes or route_hiking_nwn=yes or route_hiking_rwn=yes or route_hiking_lwn=yes or route_foot_=yes or route_foot_nwn=yes or route_foot_rwn=yes route_foot_lwn=yes
- assign nodeaccessgranted any_hikeroute
- assign is_hr and any_hikeroute not ignore_hikeroutes
- #
- # this is the cost (in Meter) for a 90-degree turn
- # The actual cost is calculated as turncost*cos(angle)
- # (Suppressing turncost while following longdistance-cycleways
- # makes them a little bit more magnetic)
- #
- assign turncost 0
- #
- # calculate the initial cost
- # this is added to the total cost each time the costfactor
- # changed
- #
- 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
- switch access=
- not motorroad=yes
- switch or access=private access=no
- 0
- 1
- #
- # calculate logical bike access
- #
- assign bikeaccess
- or any_hikeroute
- 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
- 0
- 100000
- assign onewaypenalty 0.0
- #
- # 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
- add max onewaypenalty accesspenalty
- switch and highway= not route=ferry 100000
- #
- # 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
- #
- switch route=ferry switch allow_ferries 5.67 100000
- #
- # handle hike-routes.
- #
- switch is_hr 1 # always treated as perfect (=1)
- add switch stick_to_hikeroutes 1 0.15 # everything else somewhat up
- #
- # some other highway types
- #
- switch highway=steps 1
- switch highway=pedestrian 1
- switch highway=bridleway 1
- switch highway=cycleway 10
- switch or highway=residential highway=living_street 1.1
- switch highway=service 1.1
- #
- # tracks and track-like ways are rated mainly be tracktype/grade
- # But note that if no tracktype is given (mainly for road/path/footway)
- # it can be o.k. if there's any other hint for quality
- #
- switch or highway=track or highway=road or highway=path highway=footway 1
- #
- # exclude motorways and proposed roads
- #
- switch or highway=motorway highway=motorway_link 100000
- switch or highway=proposed or highway=abandoned highway=construction 100000
- #
- # actuals roads are o.k.
- #
- switch or highway=trunk highway=trunk_link 15
- switch or highway=primary highway=primary_link 2.5
- switch or highway=secondary highway=secondary_link 1.5
- switch or highway=tertiary highway=tertiary_link 1.2
- switch highway=unclassified 1.1
- #
- # default for any other highway type not handled above
- #
- 2.0
- ---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
- 0
- 1000000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement