# *** The running profile is for runners who want # *** to avoid car traffic, prefer even/paved surfaces, # *** minimize turns, and avoid traffic signals # *** for an optimal running experience. ---context:global # following code refers to global config # Foot profile assign validForFoot = true assign validForBikes = false # ============================================ # MOST COMMONLY ADJUSTED SETTINGS FOR RUNNERS # ============================================ # Traffic signal avoidance assign avoid_traffic_lights = true # %avoid_traffic_lights% | Set true to avoid traffic signals | boolean assign traffic_signal_penalty = 700 # %traffic_signal_penalty% | Penalty cost for crossing traffic signals (higher = more avoidance) | number # Surface and weather conditions assign iswet = 1 # %iswet% | Set to 1 to avoid muddy surfaces and wet conditions | boolean assign require_lit = false # %require_lit% | Set true to strongly prefer lit routes (for night running) | boolean # Elevation preferences (runners prefer flat terrain) assign consider_elevation = true # %consider_elevation% | Set true to favor flat routes | boolean # Traffic consideration assign consider_traffic = true # %consider_traffic% | Activate to consider traffic estimates | boolean # ============================================ # LESS COMMON SETTINGS # ============================================ assign allow_steps = false # %allow_steps% | Set true to allow steps (not recommended for running) | boolean assign allow_ferries = false # %allow_ferries% | Set true to allow ferries | boolean assign consider_noise = true # %consider_noise% | Activate to prefer a low-noise route | boolean assign consider_river = true # %consider_river% | Activate to prefer a route along rivers, lakes, etc. | boolean assign consider_forest = true # %consider_forest% | Activate to prefer a route in forest or parks | boolean assign consider_town = false # %consider_town% | Activate to bypass cities / big towns as far as possible | boolean assign add_beeline = false # %add_beeline% | Enable beeline on distant start/end points | boolean # ============================================ # ELEVATION PARAMETERS # ============================================ assign downhillcost = 100 # %downhillcost% | Cost for going downhill (impact on knees) | number assign downhillcutoff = 3.0 # %downhillcutoff% | Gradients below this value in percents are not counted | number assign uphillcost = 180 # %uphillcost% | Cost for going uphill (runners avoid hills more than bikers) | number assign uphillcutoff = 3.0 # %uphillcutoff% | Gradients below this value in percents are not counted | number assign downhillcost = if consider_elevation then downhillcost else 0 assign uphillcost = if consider_elevation then uphillcost else 0 # Elevation buffer parameters - filter elevation noise and prefer truly flat routes assign elevationpenaltybuffer = 3 # %elevationpenaltybuffer% | Start applying elevation cost after this buffer (m) | number assign elevationmaxbuffer = 8 # %elevationmaxbuffer% | Apply full elevation cost above this buffer (m) | number assign elevationbufferreduce = 1.5 # %elevationbufferreduce% | Rate of buffer reduction (slope %) - runners prefer consistent flat terrain | number # Routing optimization - adjust for pedestrian routing assign pass1coefficient = 1.44 # %pass1coefficient% | Heuristic coefficient for first routing pass | number assign pass2coefficient = 0.0 # %pass2coefficient% | Heuristic coefficient for second pass (0 disables it for faster routing) | number # Kinematic model parameters (travel time computation for running) assign totalMass = 75 # %totalMass% | Mass (in kg) of runner, for travel time computation | number assign maxSpeed = 15 # %maxSpeed% | Maximum running speed (in km/h), for travel time computation | number assign S_C_x = 0.4 # %S_C_x% | Drag coefficient times the reference area (in m^2), for travel time computation | number assign C_r = 0.04 # %C_r% | Rolling resistance coefficient (dimensionless), for travel time computation | number assign bikerPower = 250 # %bikerPower% | Average power (in W) provided by the runner, for travel time computation | number # Turn instructions settings assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style, 7=locus-old-style] assign turnInstructionCatchingRange = 40 # %turnInstructionCatchingRange% | Within this distance (in m) several turning instructions are combined into one | number assign turnInstructionRoundabouts = true # %turnInstructionRoundabouts% | Set "false" to avoid generating special turning instructions for roundabouts | boolean assign considerTurnRestrictions = false # %considerTurnRestrictions% | Turn restrictions are less relevant for pedestrians | boolean assign processUnusedTags = false # %processUnusedTags% | Set true to output unused tags in data tab | boolean ---context:way # following code refers to way-tags # classifier constants assign classifier_none = 1 assign classifier_ferry = 2 # # pre-calculate some logical expressions # # Surface quality detection assign ispaved = surface=paved|asphalt|concrete|paving_stones assign isunpaved = not or surface= or ispaved surface=fine_gravel|cobblestone assign isprobablymuddy = or surface=unpaved|mud|grass|dirt|ground|earth|sand tracktype=grade4|grade5 assign isfirm = or ispaved or surface=fine_gravel|compacted tracktype=grade1 # Smoothness quality (ideal for running surface assessment) assign issmooth = or smoothness=excellent|good smoothness= assign isrough = smoothness=bad|very_bad|horrible|very_horrible|impassable # Mountain path detection - only block very technical hiking trails assign ismountainpath = sac_scale=hiking|mountain_hiking|demanding_mountain_hiking|alpine_hiking|demanding_alpine_hiking|difficult_alpine_hiking # MTB scale penalty - progressive cost based on technical difficulty # mtb:scale=0 is easy/accessible, higher numbers are more technical assign mtb_scale_penalty = if mtb:scale=0 then 0.0 else if mtb:scale=1 then 0.5 else if mtb:scale=2 then 1.5 else if mtb:scale=3 then 3.0 else if mtb:scale=4 then 5.0 else if mtb:scale=5 then 8.0 else if mtb:scale=6 then 10.0 else 0.0 # Hiking/running route detection - allow access to designated routes assign any_hiking_route = if route_hiking_iwn=yes then true else if route_hiking_nwn=yes then true else if route_hiking_rwn=yes then true else if route_hiking_lwn=yes then true else false assign nodeaccessgranted = if any_hiking_route then true else highway=footway|path|pedestrian # # Turn cost - prefer routes with fewer turns for better running flow # This is the cost (in Meter) for a 90-degree turn # The actual cost is calculated as turncost*cos(angle) # assign turncost = if junction=roundabout then 0 else 90 # # for any change in initialclassifier, initialcost is added once # assign initialclassifier = if route=ferry then classifier_ferry else classifier_none # # calculate the initial cost # this is added to the total cost each time the costfactor changed # assign initialcost = if ( equal initialclassifier classifier_ferry ) then 10000 else 0 # # implicit access here just from the motorroad tag # assign defaultaccess = if access= then not motorroad=yes else if access=private|no then false else true # # calculate logical foot access # assign footaccess = if foot= then defaultaccess else not foot=private|no|use_sidepath # # if no foot access, route is forbidden # assign accesspenalty = if footaccess then 0 else 10000 # # handle one-ways (less relevant for pedestrians, but some paths may be one-way) # assign badoneway = if reversedirection=yes then if oneway= then junction=roundabout else oneway=yes|true|1 else oneway=-1 assign onewaypenalty = if ( badoneway ) then ( if ( not footaccess ) then 100 else 2.0 # minor penalty for pedestrians going wrong way ) else 0.0 # add estimate tags for traffic consideration assign traffic_penalty switch consider_traffic switch estimated_traffic_class= 0 switch estimated_traffic_class=1|2 0.1 switch estimated_traffic_class=3 0.3 switch estimated_traffic_class=4 0.6 switch estimated_traffic_class=5 1.0 switch estimated_traffic_class=6|7 2.0 99 0 assign noise_penalty switch consider_noise switch estimated_noise_class= 0 switch estimated_noise_class=1 0.2 switch estimated_noise_class=2 0.4 switch estimated_noise_class=3 0.7 switch estimated_noise_class=4 1.2 switch estimated_noise_class=5 1.5 switch estimated_noise_class=6 2.0 0 0 assign no_river_penalty switch consider_river switch estimated_river_class= 2 switch estimated_river_class=1 1.3 switch estimated_river_class=2 1 switch estimated_river_class=3 0.7 switch estimated_river_class=4 0.4 switch estimated_river_class=5 0.1 switch estimated_river_class=6 0 99 0 assign no_forest_penalty switch consider_forest switch estimated_forest_class= 1 switch estimated_forest_class=1 0.5 switch estimated_forest_class=2 0.4 switch estimated_forest_class=3 0.25 switch estimated_forest_class=4 0.15 switch estimated_forest_class=5 0.1 switch estimated_forest_class=6 0 99 0 assign town_penalty switch consider_town switch estimated_town_class= 0 switch estimated_town_class=1 0.5 switch estimated_town_class=2 0.9 switch estimated_town_class=3 1.2 switch estimated_town_class=4 1.3 switch estimated_town_class=5 1.4 switch estimated_town_class=6 1.6 99 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 isresidentialorliving = or highway=residential|living_street living_street=yes assign costfactor # # exclude rivers, rails etc. # if ( and highway= not route=ferry ) then 10000 # # exclude motorways and proposed/construction roads # else if ( highway=motorway|motorway_link ) then 10000 else if ( highway=proposed|abandoned|construction ) then 1000000 # # all other exclusions below (access, steps, ferries,..) # should not be deleted by the decoder, to be available # in voice-hint-processing # else min 9999 add town_penalty add no_forest_penalty add no_river_penalty add noise_penalty add traffic_penalty add mtb_scale_penalty # # apply access penalties # add accesspenalty # # steps are heavily penalized for running (or forbidden if disabled) # if ( highway=steps ) then ( if allow_steps then 100 else 10000 ) # # ferries # else if ( route=ferry ) then ( if allow_ferries then 8.0 else 10000 ) # # Apply lighting penalty if running in dark # else add ( if and require_lit not lit=yes then 3 else 0 ) # # Apply wet/muddy surface penalty # add ( if and iswet isprobablymuddy then 5 else 0 ) # # Block mountain paths - too technical for running # if ( ismountainpath ) then 10000 # # Prefer paved pedestrian infrastructure with smoothness consideration # else if ( highway=footway ) then ( if ispaved then ( if issmooth then 1.0 else 1.1 ) else if isrough then 3.0 else 1.5 ) else if ( highway=pedestrian ) then ( if ispaved then ( if issmooth then 1.0 else 1.1 ) else if isrough then 3.5 else 2.0 ) else if ( highway=path ) then ( if ismountainpath then 10000 else if isfirm then ( if issmooth then 1.1 else 1.2 ) else if isrough then 5.0 else 3.0 ) # # Cycleways - prefer paved over unpaved # else if ( highway=cycleway ) then ( if ispaved then 1.3 else if surface=fine_gravel|compacted then 1.4 else if surface=unpaved|dirt then 1.8 else if isrough then 3.0 else 1.5 ) # # Residential streets - prefer those with sidewalks # else if ( isresidentialorliving ) then ( if sidewalk=yes|both|left|right then ( if issmooth then 1.4 else 1.5 ) else if ispaved then ( if issmooth then 1.9 else 2.0 ) else if isrough then 4.0 else 3.0 ) # # Service roads # else if ( highway=service ) then ( if sidewalk=yes|both|left|right then ( if issmooth then 1.7 else 1.8 ) else if issmooth then 2.3 else if isrough then 4.0 else 2.5 ) # # tracks - only good if well-paved and smooth # else if ( highway=track|road ) then ( if ( tracktype=grade1 ) then ( if ispaved then ( if issmooth then 1.2 else 1.3 ) else 2.0 ) else if ( tracktype=grade2 ) then ( if issmooth then 2.5 else 3.0 ) else if ( tracktype=grade3 ) then 5.0 else if ( tracktype=grade4 ) then 8.0 else if ( tracktype=grade5 ) then 10.0 else ( if ispaved then 1.5 else 4.0 ) ) # # Avoid bridleways (often unpaved, for horses) # else if ( highway=bridleway ) then 6.0 # # Major roads - heavily penalized, prefer only if sidewalk exists # else if ( highway=trunk|trunk_link ) then ( if sidewalk=yes|both|left|right then 8 else 10000 ) else if ( highway=primary|primary_link ) then ( if sidewalk=yes|both|left|right then 5 else 10 ) else if ( highway=secondary|secondary_link ) then ( if sidewalk=yes|both|left|right then 3.5 else 6 ) else if ( highway=tertiary|tertiary_link ) then ( if sidewalk=yes|both|left|right then 2.5 else 4 ) else if ( highway=unclassified ) then ( if sidewalk=yes|both|left|right then 2.0 else 3.5 ) # # default for any other highway type not handled above # else 5.0 # # uphillcostfactor/downhillcostfactor - replaces costfactor on slopes for stronger elevation penalty # These are used when elevation buffer is saturated to strongly discourage hilly routes # assign uphillcostfactor = 2.5 # Runners strongly avoid uphill segments - multiply base cost by 2.5x assign downhillcostfactor = 1.8 # Downhill impacts knees - multiply base cost by 1.8x # 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 ( isresidentialorliving ) then 8 else if ( highway=service ) then 6 else if ( highway=footway|pedestrian ) then 10 else if ( highway=path ) then 8 else if ( highway=cycleway ) then 6 else if ( highway=track ) then if tracktype=grade1 then 6 else 4 else if ( highway=bridleway|road ) then 4 else if ( highway=steps ) 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 ( or isresidentialorliving highway=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 # include useful tags in the response's WayTags for analysis assign dummyUsage = or smoothness= or surface= or lit= or sidewalk= or sac_scale= or mtb:scale= or tracktype= or route_hiking_iwn= or route_hiking_nwn= or route_hiking_rwn= route_hiking_lwn= ---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 footaccess = if foot= then defaultaccess else not foot=private|no # # Add heavy penalty for traffic signals to avoid stopping during runs # Uses the traffic_signal_penalty parameter from global config # assign initialcost2 = if footaccess then 0 else 1000000 assign initialcost = if avoid_traffic_lights then ( if crossing=traffic_signals then traffic_signal_penalty else initialcost2 ) else initialcost2