---context:global # following code refers to global config # the elevation parameters assign downhillcost 0 assign downhillcutoff 1.5 assign uphillcost 0 assign uphillcutoff 1.5 assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style assign validForFoot 1 assign processUnusedTags = true # %processUnusedTags% | Set to true to output unused tags in data tab | boolean ---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 turncost 0 assign initialclassifier = if route=ferry then 1 else 0 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_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 assign accesspenalty switch or bikeaccess footaccess 0 100000 assign hasSidewalk and not sidewalk= not sidewalk=no #sidewalk attribute is not empty and not no assign isRoad #what counts as road for default maxspeed penalty or highway=trunk or highway=primary or highway=secondary or highway=tertiary or highway=residential or highway=service 0 assign wheelchaircostfactor #add if ( and not hasSidewalkOnRoad maxspeed=100 ) then 50 else 0 add if ( not hasSidewalk ) then #add heavy penalties for fast ways without sidewalk. If it is mapped separately, then that way is preferred anyway. if ( maxspeed=130 ) then 80 else if ( maxspeed=120 ) then 70 else if ( maxspeed=110 ) then 60 else if ( maxspeed=100 ) then 50 else if ( maxspeed=90 ) then 40 else if ( maxspeed=80 ) then 30 else if ( maxspeed=70 ) then 20 else if ( maxspeed=60 ) then 10 else if ( maxspeed=50 ) then 5 else if ( maxspeed=40 ) then 2 else if ( maxspeed=30 ) then 1.5 else if ( maxspeed=20 ) then 1.1 else if ( and isRoad and not hasSidewalk maxspeed= ) then 2 #default penalty for roads without maxspeed without sidewalk else 0 else 0 multiply if ( or wheelchair=no or surface=stepping_stones surface=rock ) then 9999 else 1 #exclude everything that is not for wheelchairs multiply if ( wheelchair=yes ) then 0.75 else 1 #25% better if wheelchair tag is added multiply if ( wheelchair=designated ) then 0.5 else 1 #prefer ways specifically made for wheelchairs #surface multiply if ( surface=sand ) then 40 else 1 multiply if ( surface=mud ) then 40 else 1 multiply if ( surface=woodchips ) then 20 else 1 multiply if ( surface=dirt ) then 20 else 1 multiply if ( surface=clay ) then 20 else 1 multiply if ( surface=pebblestone ) then 20 else 1 multiply if ( surface=earth ) then 20 else 1 multiply if ( surface=grass_paver ) then 20 else 1 multiply if ( surface=snow ) then 10 else 1 multiply if ( surface=ice ) then 10 else 1 multiply if ( surface=salt ) then 20 else 1 multiply if ( surface=grass ) then 10 else 1 multiply if ( surface=unhewn_cobblestone ) then 10 else 1 multiply if ( surface=grass ) then 10 else 1 multiply if ( surface=grass ) then 10 else 1 multiply if ( surface=grass ) then 10 else 1 multiply if ( surface=fine_gravel ) then 10 else 1 #bad for wheelchairs but sometimes mappers use fine_gravel instead of compacted multiply if ( surface=gravel ) then 10 else 1 #bad for wheelchairs but sometimes mappers use gravel instead of compacted multiply if ( surface=ground ) then 8 else 1 multiply if ( surface=unpaved ) then 3 else 1 multiply if ( surface=artificial_turf ) then 20 else 1 multiply if ( surface=cobblestone ) then 2.5 else 1 multiply if ( surface=sett ) then 2.5 else 1 multiply if ( surface=shells ) then 2.5 else 1 #don't really know how bad it is multiply if ( surface=compacted ) then 2.5 else 1 multiply if ( surface=concrete:lanes ) then 2.5 else 1 multiply if ( surface=carpet ) then 2 else 1 multiply if ( surface=plastic ) then 1.5 else 1 multiply if ( surface=concrete:plates ) then 1.5 else 1 multiply if ( surface=paved ) then 1.5 else 1 multiply if ( surface=metal ) then 1.5 else 1 multiply if ( surface=metal_grid ) then 1.5 else 1 multiply if ( surface=wood ) then 1.5 else 1 multiply if ( surface=paving_stones ) then 1.2 else 1 multiply if ( surface=bricks ) then 1.2 else 1 multiply if ( surface=chipseal ) then 1.1 else 1 multiply if ( surface=concrete ) then 1.1 else 1 multiply if ( surface=rubber ) then 0.9 else 1 #"These surfaces are usually made of rubber designed specifically #for aesthetics, child safety, and/or ADA wheelchair accessibility" multiply if ( surface=asphalt ) then 0.9 else 1 #asphalt is 10% better multiply if ( surface=tartan ) then 0.8 else 1 multiply if ( surface=acrylic ) then 0.8 else 1 #exclude some roads when there is no sidewalk multiply if ( and or highway=trunk or highway=primary highway=secondary #exclude these roads in next step not hasSidewalk ) then 9999 else 1 #exclude previous roads if no sidewalk #road types multiply if ( highway=trunk ) then 2 else 1 #has sidewalk but we don't like it as much multiply if ( highway=primary ) then 1.5 else 1 multiply if ( highway=secondary ) then 1.2 else 1 multiply if ( highway=tertiary ) then 1.1 else 1 multiply if ( highway=unclassified ) then 1.1 else 1 multiply if ( informal=yes ) then 5 else 1 #avoid informal paths #good ways multiply if ( highway=footway ) then 0.8 else 1 #footway is 20% better multiply if ( or footway=sidewalk is_sidepath=yes ) then 1.05 else 1 #and sidewalk is 5% worse multiply if ( footway=crossing ) then 1.2 else 1 #crossings are not the best #steps multiply if ( highway=steps ) then if ( ramp:wheelchair=yes ) then 1.1 #ramps are good else if ( step_count=1 ) then 50 #allow 1 step, set to 9999 if no steps should be allowed else if ( not step_count=1 ) then 9999 else 1 #no steps with more than 1 step else 1 #portable ramps multiply if ( ramp:portable=yes ) then 2 else 1 #they are good but annoying #tracktype multiply if ( and highway=track tracktype= ) then 3 else 1 #default if no tracktype is given for a track multiply if ( tracktype=grade1 ) then 1.1 else if ( tracktype=grade2 ) then 1.5 else if ( tracktype=grade3 ) then 2 else if ( tracktype=grade4 ) then 3 else if ( tracktype=grade5 ) then 5 else 1 multiply if ( and highway=steps not ( step_count=1 ) ) then 9999 else 1 #no steps with more than 1 step multiply if ( and highway=steps step_count=1 ) then 50 else 1 #allow 1 step, but with penalty 1 #multiply 1 #if ( highway=residential ) then 1.5 #else if ( highway=footway ) then 1 #else 1 assign costfactor multiply wheelchaircostfactor add accesspenalty switch and highway= not route=ferry 100000 switch route=ferry 5.67 switch or highway=motorway highway=motorway_link 100000 switch or highway=proposed highway=abandoned 100000 1 # way priorities used for voice hint generation assign isresidentialorliving = or highway=residential|living_street living_street=yes 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 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 # ... encoded into a bitmask assign classifiermask add multiply isroundabout 4 add multiply islinktype 8 multiply isgoodforcars 16 # include `smoothness=` tags in the response's WayTags for track analysis assign dummyUsage = smoothness= ---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 or bikeaccess footaccess 0 1000000 #assign initialcost #if ( wheelchair=no ) then 9999 #exclude everything that is not for wheelchairs #else if ( highway=traffic_signals ) then 30 #else if ( crossing=unmarked ) then 30 #penalty for unmarked crossings #else if ( kerb=raised ) then 100 #raised kerb as bad as 100m #else if ( highway=crossing ) then 100 #crossings are bad #else #switch or bikeaccess footaccess 0 1000000 assign crossingCost multiply if ( highway=crossing ) then 10 else 0 #avoid crossings. 0 cost if tag is not set multiply if ( crossing=no ) then 9999 else 1 #no way if there is no crossing multiply if ( crossing=traffic_signals ) then 0.5 else 1 #better with traffic signals multiply if ( crossing:island=yes ) then 0.8 else 1 #better with islands multiply if ( or crossing=zebra crossing_ref=zebra ) then 0.5 else 1 #better with zebras multiply if ( crossing=unmarked ) then 2 else 1 #even worse if no markings or traffic signals 1 assign initialcost switch or bikeaccess footaccess add if ( wheelchair=no ) then 9999 else 0 add if ( highway=traffic_signals ) then 5 else 0 add if ( and crossing=unmarked not highway=traffic_signals ) then 30 else 0 #penalty for unmarked crossings add if ( kerb=raised ) then 100 else 0 #raised kerb as bad as 100m #barriers add if ( barrier= ) then 0 else if ( barrier=kissing_gate ) then if ( wheelchair=yes ) then 100 else 9999 #kissing gates are bad if wheelchairs can pass and else impassable else if ( barrier=cycle_barrier ) then if ( wheelchair=yes ) then 50 #annoying, but not so bad else if ( wheelchair=no ) then 9999 #not for wheelchairs else if ( wheelchair= ) then 200 #probably passable else 0 else 0 add crossingCost 0 10000