# ***escooter 02.02.20 # *** nur auf befestigten Wegen, bevorzugt ohne Autoverkehr oder mit Fahrradspuren #################################################################################### ---context:global # Globale Einstellungen für die Routerengine # Use the following switches to change behaviour # (1=yes, 0=no): assign consider_elevation = true # "true" -> Höheninformationen werden berücksichtigt # assign allow_steps = true # "false" -> Treppen werden vermieden # assign allow_ferries = false # "false" -> Fähren werden vermieden assign ignore_cycleroutes = false # "false" -> ausgwiesene Fahrradrouten werden bevorzugt assign stick_to_cycleroutes = false # "true" -> ausgewiesene Fahrradrouten werden stark bevorzugt assign avoid_unsafe = true # "true" Straßen mit Autoverkehr werden vermieden assign turnInstructionMode = 0 # ohne Navigationsanweisungen assign validForBikes = true # Fahrradnavigationsmodus # Berücksichtigung der Höhendaten assign downhillcost = 30 # Umweg in m um 1 m Höhendifferenz zu vermeiden assign downhillcutoff = 1.5 # ab einem Gefälle von über x % assign uphillcost = 40 # Umweg in m um 1 m Höhendifferenz zu vermeiden assign uphillcutoff = 1.5 # ab einer Steigung vom über x % # classifier constants assign classifier_none = 1 assign classifier_ferry = 2 ################################################################################# ---context:way # following code refers to way-tags # # vorgelagerte Berechung einiger logische Ausdrücke # # Handelt es sich um eine ausgewiesene Fahrradroute assign any_cycleroute = if route_bicycle_icn=yes then true # International Cycling Network route else if route_bicycle_ncn=yes then true # National Cycling Network route else if route_bicycle_rcn=yes then true # regional cycle route else if route_bicycle_lcn=yes then true # local cycle routes else false # ??? assign nodeaccessgranted = if any_cycleroute then true else lcn=yes # ???? assign is_ldcr = if ignore_cycleroutes then false else any_cycleroute # Handelt es sich um einen ausgewiesenen Fahrradweg ? assign isbike = or ( or bicycle=yes|permissive|designated lcn=yes ) cycleway=lane # Hat der Weg einen festen Belag ? assign ispaved = surface=paved|asphalt|concrete|paving_stones # Ist die Oberfläche des Weges weich ? assign isunpaved = not or surface= or ispaved surface=fine_gravel|cobblestone # Ist der Weg unter Umständen doch geeignet ? assign probablyGood = or ispaved and isbike not isunpaved # # Die Kosten in Meter für eine 90° Richtungsänderung # Berechnung: turncost*cos(angle) # assign turncost = if junction=roundabout then 0 else 40 # # for any change in initialclassifier, initialcost is added once # assign initialclassifier = if route=ferry then classifier_ferry # -> 2 else classifier_none # -> 1 # # calculate the initial cost # this is added to the total cost each time the costfactor # changed # # in dem Fall nur zur Vermeidung von Fähren assign initialcost = if ( equal initialclassifier classifier_ferry ) then 10000 else 0 # # implicit access here just from the motorroad tag # (implicit access rules from highway tag handled elsewhere) # assign defaultaccess = if access= then not motorroad=yes else if access=private|no then false else true # # calculate logical bike access # assign bikeaccess = if any_cycleroute then true else if bicycle= then ( if vehicle= then defaultaccess else not vehicle=private|no ) else not bicycle=private|no|dismount # # calculate logical foot access # assign footaccess = if bikeaccess then true else if bicycle=dismount then true else if foot= then defaultaccess else not foot=private|no # # if not bike-, but foot-acess, just a moderate penalty, # otherwise access is forbidden # assign accesspenalty = if bicycle=no then 500 else if bikeaccess then 0 else if footaccess then 50 else 10000 # # 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 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 100 else if ( highway=secondary|secondary_link ) then 100 else if ( highway=tertiary|tertiary_link ) then 20 else 4.0 ) else 0.0 # # Berechung des Kostenfaktors. Das ist der Faktor, mit dem die Länge des Wegsegmentes # multipliziert wird um die Kosten für dieses Wegsegment zu berechnen. # Der Kostenfaktor muss >=1 sein. Die Kostenfaktoren für die bevorzugten Wege sollten # möglichst nahe an 1 sein. # assign costfactor # # Ausschließen von Flüssen und Bahnlinien,... # if ( and highway= not route=ferry ) then 10000 # # Ausschließen von Autobahnen und geplanten und stillgelegten Straßen # else if ( highway=motorway|motorway_link ) then 10000 else if ( highway=proposed|abandoned ) then 10000 else min 9999 # # Addition der Einbahnstraßen und Zugangskosten # add max onewaypenalty accesspenalty # # steps and ferries are special. Note this is handled # before the cycleroute-switch, to be able # to really exlude them by setting cost to infinity # if ( highway=steps ) then 300 # Kosten in Meter für Treppen else if ( route=ferry ) then 10000 # Ausschließen von Fähren else add ( if stick_to_cycleroutes then 0.0 else 0.00 ) # everything else somewhat up # # # Kosten einiger anderen highway Typen # if ( highway=pedestrian ) then 1.2 else if ( highway=bridleway ) then 10 else if ( highway=cycleway ) then 1 else if ( highway=residential|living_street ) then 2 else if ( highway=service ) then ( if isunpaved then 5 else 1.0 ) # # Wege und Pfade werden hauptsächlich über tracktype/grade bewertet. # 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 # else if ( highway=track|road|path|footway ) then ( if ( tracktype=grade1 ) then 1.0 else if ( mtb:scale:uphill=2 ) then 1000 else if ( mtb:scale:uphill=3 ) then 5000 else if ispaved then 1.2 else if ( tracktype=grade2 ) then 5 else if ( tracktype=grade3 ) then 10 else if ( mtb:scale=0 ) then 200 else if ( mtb:scale=1 ) then 1000 else if ( tracktype=grade4 ) then 500 else if ( tracktype=grade5 ) then 500 else if ( highway=footway ) then 2 else if ( foot=designated ) then 2 else if ( bicycle=designated ) then 1.2 else if ( bicycle=yes ) then 2 else if ( is_ldcr ) then 5 else 500.0 # alle anderen ) # addiert pauschal 2 zum Kostenfaktor wenn es sich um eine Straße mit Autoverkehr # ohne Fahrradweg handelt. Je höher die Zahl ist, desto konsequenter werden Straßen mit Autoverkehr gemieden # else add ( if ( and avoid_unsafe not isbike ) then 1.5 else 0 ) # # actuals roads are o.k. if we have a bike hint # if ( highway=trunk|trunk_link ) then ( if isbike then 1.2 else 50 ) else if ( highway=primary|primary_link ) then ( if isbike then 1.0 else 50 ) else if ( highway=secondary|secondary_link ) then ( if isbike then 1.0 else 20 ) else if ( highway=tertiary|tertiary_link ) then ( if isbike then 1.0 else 4 ) else if ( highway=unclassified ) then ( if isbike then 1.0 else 1.5 ) # # default for any other highway type not handled above # else 100.0 ---context:node # following code refers to node tags assign defaultaccess = if ( access= ) then true # add default barrier restrictions here! else if ( access=private|no ) then false else true assign bikeaccess = 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 bikeaccess then 0 else ( if footaccess then 500 else 1000000 )