# *** Easy cycling profile - city bike, no helmet *** # # Built for relaxed, low-stress riding on an ordinary city bike: # # - separated cycle infrastructure only: cycleways, bicycle roads, and # cycle *tracks* alongside roads. A painted cycle lane or a shoulder # still puts you in the traffic stream, so it does NOT count as cycle # infrastructure here (switch: allow_cycle_lanes). # - trunk and motorway are forbidden outright. Primary and secondary roads # without a separated cycle track are priced as last-resort gap-crossers, # not banned: about 78 per metre plus 300 to join one, so a kilometre of # big road would need a 71 km detour to be worth riding, while a 15 m gap # at a junction can still be crossed. Set forbid_big_roads for an absolute # ban, and expect long detours around short gaps if you do. # - tertiary / unclassified roads without a track are heavily penalised, # the more so the faster the traffic on them. Residential and living # streets stay usable, otherwise routes cannot connect at all. # - there is a one-off cost for *entering* a mixed-traffic road, so the # router will not briefly hop onto one to save a few metres. # - loose surfaces (gravel, sand, dirt, mud, grass) are heavily penalised; # asphalt / concrete / paved is what the profile looks for. Surface and # condition costs are *multipliers*, not additions, so a bad surface can # never make a road cheaper than separated cycle infrastructure. # - hills are avoided hard: high uphill cost with a low cutoff, plus a # slope cost factor derived from the way cost. # - turns are expensive, so the route stays as straight as it can. # - steps, ferries, fords, mountain paths and MTB trails are out. # - traffic signals, crossings, raised kerbs, speed bumps, level crossings # and awkward barriers all cost something, because stopping and # dismounting is exactly what "easy" is supposed to avoid. # # Expect routes noticeably longer than the direct distance - that is the # point. Every number that matters is a parameter below and can be edited # in BRouter-Web's profile panel. # # References: trekking.brf, fastbike-verylowtraffic.brf and gravel.brf from # the BRouter repo, plus brouter_running_profile.brf. ---context:global # following code refers to global config # Bike profile assign validForBikes = true # ============================================ # MOST COMMONLY ADJUSTED SETTINGS # ============================================ # --- What counts as an acceptable road ------------------------------------ # Big roads are priced as gap-crossers, not banned. A ban cannot be traded # off against anything, so 15 m of under-tagged road at a junction was costing # a 700 m climbing detour. At 40 - which traffic and noise multiply to about # 78 - plus 300 to join one, riding a kilometre of big road would need a 71 km # detour to be worth it, so you still never ride along one. Turn the switch on # for an absolute guarantee, and accept that routing will sometimes fail or # detour absurdly where the cycleway network has gaps. assign forbid_big_roads = false # %forbid_big_roads% | Forbid primary/secondary roads outright rather than pricing them as last-resort gap-crossers. Guarantees you are never routed onto one, at the cost of long detours around short gaps | boolean assign big_road_penalty = 40 # %big_road_penalty% | Cost of a big road with no bike provision at all. Multiplied up by its traffic and noise | number assign big_road_lane_cost = 5 # %big_road_lane_cost% | Cost of a big road that at least has a painted cycle lane. This is the escape hatch for short gaps in the cycleway network - it is multiplied up by the traffic and noise on that road, so a nasty one lands near 12-15 and is only ever worth it for a hundred metres | number assign allow_cycle_lanes = false # %allow_cycle_lanes% | Count painted cycle lanes / bus lanes / shoulders as real cycle infrastructure (they keep you in the traffic stream) | boolean assign no_track_penalty_tertiary = 10 # %no_track_penalty_tertiary% | Cost of a tertiary road without a separated cycle track | number assign no_track_penalty_minor = 6 # %no_track_penalty_minor% | Cost of an unclassified road without a separated cycle track | number assign residential_cost = 1.9 # %residential_cost% | Cost of an ordinary residential street (lower = more willing to use them) | number assign road_initialcost = 300 # %road_initialcost% | One-off cost (in m) for joining a mixed-traffic road, to stop short hops onto them | number # --- Surface -------------------------------------------------------------- # Surface costs are MULTIPLIERS on the way's cost, not additions to it - see # the comment above the cost factor at the bottom of the way section for why. assign forbid_loose_surface = false # %forbid_loose_surface% | Block gravel/sand/dirt outright instead of penalising it heavily | boolean assign gravel_multiplier = 6 # %gravel_multiplier% | Cost multiplier on gravel / pebblestone | number assign sand_multiplier = 12 # %sand_multiplier% | Cost multiplier on sand and mud | number assign unpaved_multiplier = 7 # %unpaved_multiplier% | Cost multiplier on ground / dirt / earth / grass | number assign fine_gravel_multiplier = 2.0 # %fine_gravel_multiplier% | Cost multiplier on fine gravel / compacted (the typical park path) | number assign cobblestone_multiplier = 4.5 # %cobblestone_multiplier% | Cost multiplier on cobblestone / sett | number assign paving_stones_multiplier = 1.4 # %paving_stones_multiplier% | Cost multiplier on paving stones | number # --- Hills ---------------------------------------------------------------- assign consider_elevation = true # %consider_elevation% | Set true to favour flat routes | boolean assign uphillcost = 180 # %uphillcost% | Cost for going uphill (high = avoid climbs hard) | number assign uphillcutoff = 1.0 # %uphillcutoff% | Gradients below this value in percent are not counted | number assign downhillcost = 40 # %downhillcost% | Cost for going downhill | number assign downhillcutoff = 1.5 # %downhillcutoff% | Gradients below this value in percent are not counted | number assign uphill_multiplier = 3.0 # %uphill_multiplier% | Way cost is multiplied by this on sustained climbs | number assign downhill_multiplier = 1.2 # %downhill_multiplier% | Way cost is multiplied by this on sustained descents | number # --- Turns and stops ------------------------------------------------------ assign turncost_base = 220 # %turncost_base% | Cost (in m) of a 90-degree turn. Higher = straighter, simpler routes | number assign traffic_signal_penalty = 150 # %traffic_signal_penalty% | Cost (in m) for a traffic-signal crossing | number assign crossing_penalty = 25 # %crossing_penalty% | Cost (in m) for an unsignalled road crossing | number assign crossing_initialcost = 30 # %crossing_initialcost% | Cost (in m) for a marked cycle/foot crossing of a road | number assign level_crossing_penalty = 200 # %level_crossing_penalty% | Cost (in m) for a railway level crossing | number assign consider_crossings = true # %consider_crossings% | Charge extra where the road being crossed is a big one | boolean # --- Things to keep off the route ----------------------------------------- assign allow_steps = false # %allow_steps% | Set true to allow steps (you would have to carry the bike) | boolean assign allow_ferries = false # %allow_ferries% | Set true to allow ferries | boolean assign allow_pushing = true # %allow_pushing% | Allow short foot-only sections where you push the bike | boolean assign push_penalty = 40 # %push_penalty% | Cost of sections where you have to push the bike | number assign push_initialcost = 200 # %push_initialcost% | One-off cost (in m) for dismounting and remounting | number assign wrong_way_penalty = 30 # %wrong_way_penalty% | Cost of riding a one-way street against the legal direction. Lower it if your city allows contraflow cycling and detours look silly | number # ============================================ # LESS COMMON SETTINGS # ============================================ assign require_lit = false # %require_lit% | Strongly prefer lit ways (for riding in the dark) | boolean assign unlit_multiplier = 2.5 # %unlit_multiplier% | Cost multiplier on unlit ways when require_lit is set | number assign stick_to_cycleroutes = false # %stick_to_cycleroutes% | Set true to follow signed cycle routes wherever possible | boolean assign ignore_cycleroutes = false # %ignore_cycleroutes% | Set true to ignore signed cycle routes (better elevation results) | boolean assign use_proposed_cycleroutes = true # %use_proposed_cycleroutes% | Treat proposed cycle routes as real ones (much of the Helsinki rcn network is tagged proposed) | boolean assign consider_traffic = true # %consider_traffic% | Consider estimated motor traffic | boolean assign consider_noise = true # %consider_noise% | Prefer low-noise routes | boolean assign consider_river = false # %consider_river% | Prefer routes along rivers, lakes, etc. | boolean assign consider_forest = false # %consider_forest% | Prefer routes through forest or parks | boolean assign consider_town = false # %consider_town% | Bypass cities / big towns as far as possible | boolean assign add_beeline = false # %add_beeline% | Enable beeline on distant start/end points | boolean # ============================================ # ELEVATION MODEL # ============================================ assign downhillcost = if consider_elevation then downhillcost else 0 assign uphillcost = if consider_elevation then uphillcost else 0 # Small buffer and a low reduce rate, so even gentle sustained climbs cost. assign elevationpenaltybuffer = 3 # %elevationpenaltybuffer% | Elevation (m) buffered before any cost is applied | number assign elevationmaxbuffer = 8 # %elevationmaxbuffer% | Above this buffer (m) full elevation cost applies | number assign elevationbufferreduce = 0.5 # %elevationbufferreduce% | Rate (slope %) at which the buffer is converted to cost | number # ============================================ # ENGINE SETTINGS # ============================================ # Kinematic model parameters (travel time computation) - an upright city # bike: heavy, poor aerodynamics, relaxed rider. assign totalMass = 95 # %totalMass% | Mass (in kg) of bike + rider, for travel time computation | number assign maxSpeed = 28 # %maxSpeed% | Absolute maximum speed (in km/h), for travel time computation | number assign S_C_x = 0.45 # %S_C_x% | Drag coefficient times reference area (in m^2), for travel time computation | number assign C_r = 0.012 # %C_r% | Rolling resistance coefficient (dimensionless), for travel time computation | number assign bikerPower = 80 # %bikerPower% | Average power (in W) provided by the rider, for travel time computation | number # Turn instruction 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 special turning instructions for roundabouts | boolean assign considerTurnRestrictions = true # %considerTurnRestrictions% | Set true to take turn restrictions into account | boolean assign correctMisplacedViaPoints = false # %correctMisplacedViaPoints% | Set true to remove detours due to via points | boolean assign correctMisplacedViaPointsDistance = 400 # %correctMisplacedViaPointsDistance% | Only remove detours shorter than this (in m) | number assign processUnusedTags = false # %processUnusedTags% | Set true to output unused tags in the data tab | boolean ---context:way # following code refers to way-tags # classifier constants assign classifier_none = 1 assign classifier_ferry = 2 assign classifier_push = 3 assign classifier_road = 4 assign classifier_crossing = 5 # # --------------------------------------------------------------------------- # Cycle infrastructure detection # --------------------------------------------------------------------------- # # A *track* is physically separated from the carriageway - that is what this # profile looks for. A *lane* is paint on the road: you are still riding # among cars, so by default it does not count as infrastructure. # assign has_cycletrack = or cycleway=track|sidewalk|segregated|opposite_track or cycleway:both=track or cycleway:left=track|sidepath|opposite_track cycleway:right=track|sidepath|opposite_track assign has_cyclelane = or cycleway=lane|shared_lane|share_busway|opposite_lane|opposite|shoulder|unmarked_lane|shared|yes|designated|both|right|left or cycleway:both=lane|shared_lane|share_busway|shared|shoulder|yes or cycleway:left=lane|shared_lane|share_busway|opposite_lane|opposite|yes cycleway:right=lane|shared_lane|share_busway|opposite_lane|opposite|yes # A *marked* cycle lane: paint, but paint that is actually there for bikes. # Deliberately excludes shoulder= and the ambiguous cycleway=yes|both|right|left, # because a hard shoulder is not cycle provision. This is only ever used as the # escape hatch for short gaps in the cycleway network on a big road. assign has_marked_cyclelane = or cycleway=lane|shared_lane|share_busway|opposite_lane|unmarked_lane|designated or cycleway:both=lane|shared_lane|share_busway or cycleway:left=lane|shared_lane|share_busway|opposite_lane cycleway:right=lane|shared_lane|share_busway|opposite_lane assign is_bicycle_street = or bicycle_road=yes|designated cyclestreet=yes|designated # cycling explicitly allowed on the pavement alongside the road assign has_sidewalk_bicycle = or sidewalk:bicycle=yes|designated or sidewalk:left:bicycle=yes|designated sidewalk:right:bicycle=yes|designated # what this profile is willing to call "proper cycle infrastructure" assign counts_as_bikeinfra = or has_cycletrack or is_bicycle_street and allow_cycle_lanes has_cyclelane # riding physically separated from the carriageway, whatever the way is called assign is_separated_cycling = or highway=cycleway or is_bicycle_street has_cycletrack # a path/footway where cycling is signed rather than merely tolerated assign is_bike_designated = or bicycle=designated or segregated=yes or is_bicycle_street lcn=yes assign is_bike_permitted = bicycle=yes|permissive|designated # # --------------------------------------------------------------------------- # Signed cycle routes # --------------------------------------------------------------------------- # assign any_cycleroute = if not use_proposed_cycleroutes then ( if route_bicycle_icn=yes then true else if route_bicycle_ncn=yes then true else if route_bicycle_rcn=yes then true else if route_bicycle_lcn=yes then true else false ) else ( if route_bicycle_icn=yes|proposed then true else if route_bicycle_ncn=yes|proposed then true else if route_bicycle_rcn=yes|proposed then true else if route_bicycle_lcn=yes|proposed then true else false ) assign nodeaccessgranted = if any_cycleroute then true else lcn=yes assign is_ldcr = if ignore_cycleroutes then false else any_cycleroute # # --------------------------------------------------------------------------- # Surface # --------------------------------------------------------------------------- # assign ispaved = surface=asphalt|concrete|paved|paving_stones assign is_loose = surface=gravel|pebblestone|sand|mud|ground|dirt|earth|grass|clay|unpaved|rock|stone assign surface_multiplier = if ( and forbid_loose_surface is_loose ) then 10000 else if ( surface= ) then 1.0 else if ( surface=asphalt|concrete ) then 1.0 else if ( surface=paved ) then 1.1 else if ( surface=paving_stones ) then paving_stones_multiplier else if ( surface=wood|metal ) then 1.8 else if ( surface=fine_gravel|compacted ) then fine_gravel_multiplier else if ( surface=grass_paver ) then 3.5 else if ( surface=sett|cobblestone ) then cobblestone_multiplier else if ( surface=gravel|pebblestone ) then gravel_multiplier else if ( surface=sand|mud ) then sand_multiplier else if ( surface=ground|dirt|earth|grass|clay|unpaved|rock|stone ) then unpaved_multiplier else 2.5 # where the way itself is untagged, the cycleway/footway sub-surface may say # what you will actually be riding on assign side_surface_multiplier = if not surface= then 1.0 else if ( or cycleway:surface=asphalt|concrete|paved footway:surface=asphalt|concrete|paved ) then 1.0 else if ( or cycleway:surface=paving_stones footway:surface=paving_stones ) then paving_stones_multiplier else if ( or cycleway:surface=fine_gravel|compacted footway:surface=fine_gravel|compacted ) then fine_gravel_multiplier else if ( or cycleway:surface=cobblestone|sett footway:surface=cobblestone|sett ) then cobblestone_multiplier else if ( or cycleway:surface=gravel footway:surface=gravel ) then gravel_multiplier else if ( or cycleway:surface=unpaved footway:surface=unpaved ) then unpaved_multiplier else 1.0 assign smoothness_multiplier = if ( smoothness= ) then 1.0 else if ( smoothness=excellent|very_good|good ) then 1.0 else if ( smoothness=intermediate|medium ) then 1.3 else if ( smoothness=bad|poor|rough ) then 3.0 else if ( smoothness=very_bad|robust_wheels ) then 6.0 else if ( smoothness=horrible|very_horrible|impassable|high_clearance|off_road_wheels ) then 10000 else 1.0 # # --------------------------------------------------------------------------- # Technical difficulty - a city bike is not a mountain bike # --------------------------------------------------------------------------- # assign technical_multiplier = if ( sac_scale=mountain_hiking|demanding_mountain_hiking|alpine_hiking|demanding_alpine_hiking|difficult_alpine_hiking|yes ) then 10000 else if ( mtb:scale=2|2-|2+|3|4|5|6 ) then 10000 else if ( trail_visibility=bad|horrible|no ) then 10000 else if ( 4wd_only=yes ) then 10000 else if ( sac_scale=hiking|T1-hiking ) then 8 else if ( mtb:scale=1|1-|1+ ) then 8 # mtb:scale=0 is the *easiest* grade - somebody has looked at this way and # said it is rollable. Treat it as mild information, not as a warning. else if ( mtb:scale=0|0-|0+ ) then 1.2 else if ( trail_visibility=intermediate ) then 4 else if ( informal=yes ) then 2.5 else 1.0 assign incline_multiplier = if incline=steep then 4.0 else 1.0 assign lit_multiplier = if ( and require_lit not lit=yes|24/7|automatic|sunset-sunrise ) then unlit_multiplier else 1.0 # # Everything above describes what the way is *like to ride on*, and applies # equally to a cycleway and to a road. Such penalties must be multiplicative: # an additive one is proportionally brutal on the cheap ways and barely # noticed by the expensive ones, so it compresses the ordering this profile # is built on. With +12 for gravel, a gravel cycleway (1 + 12 = 13) came out # *above* an asphalt tertiary road (10 + 2 = 12) and the router put you among # cars to avoid a bad surface. A multiplier preserves the ratio exactly, so # a cycleway always beats a road of the same surface, whatever the surface. # # surface, smoothness and technical grading are three *competing descriptions # of the same physical property* - how rough this is to ride on - so they are # combined with max, not by multiplying. Multiplying them counts one fact # three times: a lane tagged surface=compacted + smoothness=intermediate + # mtb:scale=0 came out at 2.0 x 1.3 x 2.0 = 5.2, pricing an ordinary gravel # lane at 31 when trekking.brf says 1.35. (side_surface only has a value when # surface is absent, so those two never both apply.) assign roughness_multiplier = max multiply surface_multiplier side_surface_multiplier max smoothness_multiplier technical_multiplier # Gradient and darkness are independent dimensions - a way can be steep *and* # rough *and* unlit - so those do multiply. assign condition_multiplier = multiply roughness_multiplier multiply incline_multiplier lit_multiplier # # --------------------------------------------------------------------------- # Turn cost - the cost (in m) of a 90-degree turn. # High, because the point of this profile is a route you do not have to think # about. Roundabout geometry already produces many small turns, so it is not # charged again there. # --------------------------------------------------------------------------- # assign turncost = if junction=roundabout|circular then 0 else if is_ldcr then multiply turncost_base 0.5 else turncost_base # # --------------------------------------------------------------------------- # Access # --------------------------------------------------------------------------- # assign defaultaccess = if access= then not motorroad=yes else if access=private|no then false else true assign bikeaccess = if bicycle= then ( if bicycle_road=yes|designated then true else if vehicle= then ( if highway=footway|pedestrian then false else defaultaccess ) else not vehicle=private|no ) else not bicycle=private|no|dismount|use_sidepath assign footaccess = if bicycle=dismount then true else if foot= then defaultaccess else not foot=private|no|use_sidepath assign accesspenalty = if bikeaccess then 0 else if not allow_pushing then 10000 else if bicycle=dismount then push_penalty else if footaccess then push_penalty else if any_cycleroute then 15 else 10000 # # --------------------------------------------------------------------------- # Initial costs: charged once, whenever the classifier changes. This is what # stops the router from briefly dipping onto a main road, and what makes a # road crossing cost something even though it is only a few metres long. # --------------------------------------------------------------------------- # assign is_mixed_traffic_road = and highway=primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified not counts_as_bikeinfra assign is_road_crossing = or footway=crossing or cycleway=crossing path=crossing assign initialclassifier = if route=ferry then classifier_ferry else if ( and not bikeaccess footaccess ) then classifier_push else if is_mixed_traffic_road then classifier_road else if is_road_crossing then classifier_crossing else classifier_none assign initialcost = if ( equal initialclassifier classifier_ferry ) then 10000 else if ( equal initialclassifier classifier_push ) then push_initialcost else if ( equal initialclassifier classifier_road ) then road_initialcost else if ( equal initialclassifier classifier_crossing ) then crossing_initialcost else 0 # # --------------------------------------------------------------------------- # One-ways # --------------------------------------------------------------------------- # 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 ( oneway:bicycle=no ) then 0 else if ( or cycleway=opposite|opposite_lane|opposite_track or cycleway:left=opposite|opposite_lane|opposite_track cycleway:right=opposite|opposite_lane|opposite_track ) then 0 else if ( has_cycletrack ) then 0 else if ( not footaccess ) then 100 else if ( junction=roundabout|circular ) then 60 else wrong_way_penalty ) else 0.0 # # --------------------------------------------------------------------------- # Speed of the traffic you would be sharing the road with # --------------------------------------------------------------------------- # assign maxspeed_penalty = if ( not is_mixed_traffic_road ) then 0 else if ( maxspeed=10|20|30 ) then 0 else if ( maxspeed=40 ) then 1 else if ( maxspeed=50|urban ) then 2 else if ( maxspeed=60 ) then 4 else if ( maxspeed=70|rural ) then 7 else if ( maxspeed=80|90|100|110|120|130 ) then 12 else 0 # # --------------------------------------------------------------------------- # Environment estimates # --------------------------------------------------------------------------- # # # Traffic and noise describe the surroundings, which every way class shares, # so - like the surface costs - they are multipliers. As additive terms they # put a flat surcharge on exactly the ways this profile is built around: in # the Itaevaeylae corridor, where everything is noise class 6, a perfect # asphalt cycle route cost 1.50 instead of 1.05, which narrowed the margin it # should have been winning by. The caps stay, because being separated from a # noisy road is the whole point of a cycle track - the noise is the price of # the safe route, not a reason to leave it. # assign traffic_multiplier switch consider_traffic switch estimated_traffic_class= 1.0 switch estimated_traffic_class=1|2 1.1 switch estimated_traffic_class=3 1.2 switch estimated_traffic_class=4 1.35 switch estimated_traffic_class=5 1.5 switch estimated_traffic_class=6|7 1.7 1.0 1.0 assign traffic_multiplier = if is_separated_cycling then min 1.1 traffic_multiplier else traffic_multiplier assign noise_multiplier switch consider_noise switch estimated_noise_class= 1.0 switch estimated_noise_class=1 1.05 switch estimated_noise_class=2 1.1 switch estimated_noise_class=3 1.15 switch estimated_noise_class=4 1.2 switch estimated_noise_class=5 1.3 switch estimated_noise_class=6 1.4 1.0 1.0 assign noise_multiplier = if is_separated_cycling then min 1.1 noise_multiplier else noise_multiplier assign environment_multiplier = multiply traffic_multiplier noise_multiplier 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 # # --------------------------------------------------------------------------- # The base cost per highway type # --------------------------------------------------------------------------- # assign isresidentialorliving = or highway=residential|living_street living_street=yes assign is_lowspeed = or maxspeed=10|20|30 zone:maxspeed=20|30 # a big road (trunk/primary/secondary) with no separated cycle track assign big_road_cost = if forbid_big_roads then 10000 else big_road_penalty assign costfactor_highway = # # special cases first, so they really can be excluded # if ( highway=steps ) then ( if not allow_steps then 10000 else if ramp:bicycle=yes then 150 else 400 ) else if ( route=ferry ) then ( if allow_ferries then 8 else 10000 ) else if ( ford=yes|stepping_stones ) then 10000 else if ( highway=busway|corridor|platform ) then 10000 # # proper cycling infrastructure - this is what we are looking for # else if ( highway=cycleway ) then 1.0 else if ( is_bicycle_street ) then 1.1 # # paths / footways: only where cycling is signed or explicitly allowed # else if ( highway=path ) then ( if is_bike_designated then 1.1 else if is_bike_permitted then 1.6 else if bikeaccess then 2.5 else 10000 ) else if ( highway=footway ) then ( if is_bike_designated then 1.15 else if is_bike_permitted then 2.0 else 10000 ) else if ( highway=pedestrian ) then ( if is_bike_designated then 1.5 else if is_bike_permitted then 2.5 else 10000 ) # # quiet streets - needed to connect anything to anything # else if ( isresidentialorliving ) then ( if highway=living_street then 1.4 else if counts_as_bikeinfra then 1.2 else if is_lowspeed then multiply residential_cost 0.85 else residential_cost ) else if ( highway=service ) then ( if service=driveway|parking_aisle|parking then 2.8 else if service=alley then 2.2 else 2.0 ) # # ordinary roads - only acceptable with a separated cycle track # else if ( highway=unclassified ) then ( if counts_as_bikeinfra then 1.3 else if has_sidewalk_bicycle then 2.2 else if has_cyclelane then multiply no_track_penalty_minor 0.6 else if is_lowspeed then multiply no_track_penalty_minor 0.5 else no_track_penalty_minor ) else if ( highway=tertiary|tertiary_link ) then ( if counts_as_bikeinfra then 1.4 else if has_sidewalk_bicycle then 2.5 else if has_cyclelane then multiply no_track_penalty_tertiary 0.6 else no_track_penalty_tertiary ) else if ( highway=secondary|secondary_link ) then ( if counts_as_bikeinfra then 1.6 else if has_sidewalk_bicycle then 4 else if has_marked_cyclelane then big_road_lane_cost else big_road_cost ) else if ( highway=primary|primary_link ) then ( if counts_as_bikeinfra then 2.0 else if has_sidewalk_bicycle then 6 else if has_marked_cyclelane then multiply big_road_lane_cost 1.6 else big_road_cost ) # # the rest # else if ( highway=track ) then ( if ( tracktype=grade1 ) then ( if ispaved then 1.6 else 6 ) else if ( tracktype=grade2 ) then 12 else if ( tracktype= ) then ( if ispaved then 2.5 else 12 ) else 10000 ) else if ( highway=bridleway ) then 30 else if ( highway=road ) then 6 else 8 # # --------------------------------------------------------------------------- # The cost factor: the distance of a way segment is multiplied by this. # Must be >= 1. A value >= 10000 means "does not exist"; 9999 means "not # routable, but still visible to the turn-instruction generator". # --------------------------------------------------------------------------- # assign costfactor # # exclude rivers, rails etc. # if ( and highway= not route=ferry ) then 10000 # # motorways and trunk roads are never an option on a city bike, # nor are ways that do not exist (yet) # else if ( highway=motorway|motorway_link|trunk|trunk_link ) then 10000 else if ( highway=proposed|abandoned|construction|raceway|services|rest_area|bus_stop|elevator|via_ferrata ) then 10000 # # all other exclusions below (access, surface, steps, ferries, ...) stay at # 9999, so they remain available for voice-hint processing # else min 9999 # # The additive terms below are either road-only (maxspeed) or off by # default, so none of them can reorder the way classes the way an additive # surface or noise cost did. # add maxspeed_penalty add town_penalty add no_forest_penalty add no_river_penalty # # signed cycle routes get a small bonus, by making everything else # slightly more expensive # add ( if is_ldcr then 0 else ( if stick_to_cycleroutes then 0.6 else 0.05 ) ) # # apply oneway- and access-penalties # add max onewaypenalty accesspenalty # # what the way is, times what it is like to ride on, # times what it is like to be next to # multiply costfactor_highway multiply condition_multiplier environment_multiplier # # Slope cost factors. These *replace* costfactor once the elevation buffer # saturates, so they are derived from costfactor rather than being constants: # a flat constant here would make a steep bad road cheaper than a flat one. # assign uphillcostfactor = min 9999 multiply costfactor uphill_multiplier assign downhillcostfactor = min 9999 multiply costfactor downhill_multiplier # # --------------------------------------------------------------------------- # 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 6 else if ( highway=service ) then 6 else if ( highway=cycleway ) then 6 else if ( or bicycle=designated is_bicycle_street ) 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 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 # make the tags this profile reasons about visible in the response's WayTags assign dummyUsage = or smoothness= or surface= or tracktype= or lit= or maxspeed= or sidewalk= or segregated= or sac_scale= or mtb:scale= incline= ---context:node # following code refers to node tags assign defaultaccess = if ( access= ) then true 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 # # Barriers. Anything you have to lift a city bike over or squeeze it through # is expensive; anything you cannot get a bike through at all is blocked. # assign barrier_penalty = if ( barrier= ) then 0 else if ( barrier=no|entrance|kerb|border_control|checkpoint|toll_booth ) then 0 else if ( barrier=bollard|chain|rope|motorcycle_barrier|cattle_grid ) then 20 else if ( barrier=gate|lift_gate|swing_gate|sliding_gate|footgate|door ) then ( if bikeaccess then 120 else 1000000 ) else if ( barrier=cycle_barrier|chicane|bus_trap|height_restrictor|bar ) then 250 else if ( barrier=block|debris|log|fallen_tree|tree|windfall|obstacle|jersey_barrier|guard_rail ) then 300 else if ( barrier=stile|kissing_gate|turnstile|full-height_turnstile|horse_stile|hampshire_gate|sally_port|bump_gate ) then 1000000 else if ( barrier=fence|wall|hedge|ditch|spikes ) then 1000000 else 100 # # Stops cost time and effort, and routing around them is exactly what an # "easy" profile is for. # assign stop_penalty = if ( or highway=traffic_signals crossing=traffic_signals ) then traffic_signal_penalty else if ( or highway=crossing crossing=uncontrolled|zebra|marked|unmarked|island|yes ) then crossing_penalty else if ( highway=stop ) then 20 else if ( highway=give_way ) then 10 else 0 # # estimated_crossing_class is a *node* tag: it estimates how significant the # road you are crossing is. Crossing a big road is the unpleasant part, so # it is charged on top of the crossing itself. # assign crossing_class_penalty switch consider_crossings switch estimated_crossing_class= 0 switch estimated_crossing_class=0|1 0 switch estimated_crossing_class=2 20 switch estimated_crossing_class=3 50 switch estimated_crossing_class=4 90 switch estimated_crossing_class=5 140 switch estimated_crossing_class=6 200 0 0 assign railway_penalty = if ( railway=level_crossing ) then level_crossing_penalty else if ( railway=crossing ) then multiply level_crossing_penalty 0.25 else 0 # # Raised kerbs and speed bumps are unpleasant on a rigid city bike. # assign shock_penalty = add ( if kerb=raised then 30 else if kerb=rolled then 10 else 0 ) ( if traffic_calming=bump|hump|cushion|dip|rumble_strip then 15 else if traffic_calming=chicane|choker|choked_table then 10 else 0 ) assign initialcost = if bikeaccess then ( add barrier_penalty add stop_penalty add crossing_class_penalty add railway_penalty shock_penalty ) else ( if footaccess then 500 else 1000000 )