# copy from "fastbike-verylowtraffic.brf" -- Version 25.05.2020 # goal is a long-distance gravel profile to ride as much "gravel" and "fine-gravel" surface on tracktype = grade2 # it avoids small tracks because these tracks are often not ridable and need to be explored # if no offread track is suitable it falls back to low traffic paved roads # main adjustments are done via: # - surfacepenalty # - tracktypepenalty # - smoothnesspenalty # - costfactor for highway types # # This profile, developed by Ess Bee, is based on the "fastbike-lowtraffic" profile # it is intended for road cyclists who ride alone and / or in the middle of the week: thus trucks and high traffic are avoided # (cyclists in group at the weekend will rather use "fastbike.brf" or "fastbike-lowprofile.brf" as groups are better respected by cars and trucks) # # ==> where ever possible, choose: # - an asphalted way (with good smoothness) # - cycleways are prefered # - on highway=tertiary, secondary or primary whithout any cycle_way: # - avoid segments with maxspeed > 50 kmh (reduce the risk) # - avoid segments with high-traffic # # The route is calculated using the taggs of the OSM map (such as highway, surface, smoothness, maxspeed, traffic_class...) # ---context:global # following code refers to global config assign processUnusedTags 1 # set to true if you want to display all tags in the "data" # to generate turn instructions, adapt the mode by need 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=oruxmaps-style] assign turnInstructionRoundabouts = true # %turnInstructionRoundabouts% | Set to "false" to avoid generating special turning instructions for roundabouts | boolean assign turnInstructionCatchingRange = 4 assign considerTurnRestrictions true # turn restrictions are considered assign validForBikes true assign validForCars false assign validForFoot false assign is_wet false # +++ Kinematic model parameters (travel time computation) assign totalMass = 90 # %totalMass% | Mass (in kg) of the bike + biker, for travel time computation | number assign maxSpeed = 30 # %maxSpeed% | Absolute maximum speed (in km/h), for travel time computation | number assign S_C_x = 0.3 # %S_C_x% | Drag coefficient times the reference area (in m^2), for travel time computation | number assign C_r = 0.005 # %C_r% | Rolling resistance coefficient (dimensionless), for travel time computation | number assign bikerPower = 150 # %bikerPower% | Average power (in W) provided by the biker, for travel time computation | number # Use the following switches to change behaviour # (1=yes, 0=no): assign consider_elevation false # %considerElevation% | Activate to apply a penalty for uphills | boolean assign avoid_path 0 # Activate to avoid paths, e.g. to avoid conflicts with pedestrians # the elevation parameters assign downhillcost switch consider_elevation 60 0 assign downhillcutoff 1.5 assign uphillcost switch consider_elevation 100 0 assign uphillcutoff 1.5 assign uh_difficult_penalty 10 ---context:way # following code refers to way-tags # when "cycleway" only on 1 side of the road, use it only if it is on the right side in the direction of travel! assign cycleway_right if reversedirection=yes then if cycleway:left=track|lane|shared_lane then 1 else 0 else if cycleway:right=track|lane|shared_lane then 1 else 0 assign any_cycleway or cycleway=track|lane|shared_lane|shared cycleway_right # as soon it is supported in lookup, add ==> bicycle_road=yes in any_cycleway # in relation with "route=bicycle" ? 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 ispaved or surface=paved surface=asphalt assign isunpaved surface=unpaved|gravel|dirt|earth|ground|sand assign isfine_gravel surface=fine_gravel|cobblestone|compacted|paving_stones assign isconcrete surface=concrete assign turncost = if junction=roundabout then 0 else 10 # assign initialclassifier = switch route=ferry 2 1 assign initialcost = switch route=ferry 4999 0 # # get the inclination (up=1, down=-1, unknown=0) # assign inclination = if incline= then 0 else if incline=yes|up|5%|8%|10%|15%|20%|25%|30% then if reversedirection=yes then -1 else 1 else if incline=down|-5%|-8%|-10%|-15%|-20%|-25%|-30% then if reversedirection=yes then 1 else -1 else 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 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 6 10000 # # handle one-ways. On primary roads, wrong-oneways should # be close to forbidden, while on other ways we just add # 6 to the costfactor (making it at least 7 - 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|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 50 else if ( highway=secondary|secondary_link ) then 30 else if ( highway=tertiary|tertiary_link ) then 20 else 6.0 ) else 0.0 assign surfacepenalty switch surface=asphalt 1.5 switch surface=paved switch smoothness=good|excellent 0.3 0.4 # befestigte (harte) Oberfläche switch concrete=plates|lanes 1.5 # Betonplattenwege, Betonspurplatten switch surface=concrete|paving_stones|wood|metal 0.5 # Beton, Pflastersteine (geschnitzt), Holz, Metall switch surface=cobblestone|sett switch smoothness=good|excellent 1 2 # Kopfsteinpflaster # switch surface=unhewn_cobblestone 3 # ungeschnitzter Pflasterstein switch surface=fine_gravel|compacted 0 # Splitt,verdichtete Oberflaesche switch surface=grass_paver 1.5 # Rasengittersteine switch surface=pebblestone|unpaved 0.1 # Schotter, Sand, Kies, unbefestigt switch surface=gravel 0.5 # Gravel eben switch surface=ground|grass|dirt|earth|mud|clay|sand 2.0 # naturbelassene Oberfl sche, Gras, Schutz Schlamm... # if "surface" is not defined... switch surface= # then, for Primary, secondary and tertiary asphalt is very probable switch highway=primary|primary_link|secondary|secondary_link|tertiary|tertiary_link 0.5 # then, for residential & Co. probably asphalt switch highway=road|residential|unclassified 0.3 # then, for living_street something paved switch highway=living_street 0.3 # then, for "service & cycleway" possibly good (but not sure!) switch highway=service|cycleway 0.3 # in some cases only smoothness is tagged but surface not! switch smoothness=intermediate|good|excellent 0 # else, check if tracktype=grade1, then it is "something" paved, so middle penalty switch tracktype=grade1 0.9 switch tracktype=grade2 0 # if a cycleroute is defined, surface can not be horrible... switch any_cycleroute 2 5 # surface not known and probably not paved / no asphalt... 0.3 assign excludepenalty switch waterway=river|canal 10000 switch and railway=razed highway= 100 switch highway= 10 0 assign tracktypepenalty switch tracktype=grade1 0.2 switch tracktype=grade2 0 switch tracktype=grade3 1 switch tracktype=grade4 3 switch tracktype=grade5 6 # assume unknown tracks are comparable to grade4 3 assign trafficpenalty = # if any_cycleway then 0 # else if highway=primary|primary_link then ( if estimated_traffic_class=1|2 then 0 else if estimated_traffic_class=3 then 0.4 else if estimated_traffic_class=4 then 0.8 else if estimated_traffic_class=5 then 1 else if estimated_traffic_class=6|7 then 2 else 0.6 ) else if highway=secondary|secondary_link then ( if estimated_traffic_class=1|2 then 0.1 else if estimated_traffic_class=3 then 0.3 else if estimated_traffic_class=4 then 0.7 else if estimated_traffic_class=5 then 1 else if estimated_traffic_class=6|7 then 1.5 else 0.2 ) else if highway=tertiary|tertiary_link then ( if estimated_traffic_class=1|2 then 0.1 else if estimated_traffic_class=3 then 0.2 else if estimated_traffic_class=4 then 0.5 else if estimated_traffic_class=5|6|7 then 1 else 0.1 ) else 0 assign smoothnesspenalty = switch smoothness=excellent 0.9 switch smoothness=good 0.8 switch smoothness=intermediate 0.0 switch smoothness=bad 1 switch smoothness=very_bad 1.5 switch smoothness=horrible 4.7 switch smoothness=very_horrible 10 switch smoothness=impassable 20 1 # # additional penalties for other road attributes # assign mtb_sac_penalty = add if mtb:scale= then 0.0 else if mtb:scale=0- then 0.0 else if mtb:scale=0 then 0.0 else if mtb:scale=0+ then 1 else if mtb:scale=1- then 5 else if mtb:scale=1 then 20 else if mtb:scale=1+ then 30 else if mtb:scale=2- then 1000 else if mtb:scale=2 then 1000 else if mtb:scale=2+ then 1000 else if mtb:scale=3 then 1000 else if mtb:scale=4|5|6 then 9000 else 0.0 if sac_scale= then 2 else if sac_scale=hiking then 7 else if sac_scale=mountain_hiking then 50 else if sac_scale=demanding_mountain_hiking then 1000 else if sac_scale=alpine_hiking then 10000 else if sac_scale=demanding_alpine_hiking then 10000 else if sac_scale=difficult_alpine_hiking then 10000 else 0 assign mtb_uh_penalty = max 0 if mtb:scale:uphill=1 then 20 else if mtb:scale:uphill=2 then 1000 else if mtb:scale:uphill=3 then 1000 else if mtb:scale:uphill=4 then 1000 else if mtb:scale:uphill=5 then 10000 else 0 assign maxspeedpenalty = switch or highway=primary highway=primary_link # as soon "name" is supported in lookup, replace with "switch maxspeed= switch name= 2.2 1 switch maxspeed=50 0.2 # switch any_cycleway 0.2 switch maxspeed=60 0.7 switch maxspeed=70 1.2 switch maxspeed=80 1.5 switch maxspeed=90 2.0 switch maxspeed=100 3.0 switch maxspeed=110 11 switch maxspeed=120 12 switch maxspeed=130 13 switch maxspeed= 2.2 0 switch or highway=secondary highway=secondary_link # as soon "name" is supported in lookup, replace with "switch maxspeed= switch name= 0.9 0.2 switch maxspeed=50 0.1 # switch any_cycleway 0.1 switch maxspeed=60 0.2 switch maxspeed=70 0.9 switch maxspeed=80 1.5 switch maxspeed=90 2 switch maxspeed=100 2.5 switch maxspeed=110 11 switch maxspeed=120 12 switch maxspeed=130 13 switch maxspeed= 0.9 0 switch or highway=tertiary highway=tertiary_link # as soon "name" is supported in lookup, replace with "switch maxspeed= switch name= 0.2 0.1 switch maxspeed=50 0 switch maxspeed=60 0.1 # switch any_cycleway 0.05 switch maxspeed=70 0.2 switch maxspeed=80 0.2 switch maxspeed=90 0.3 switch maxspeed=100 0.4 switch maxspeed=110 11 switch maxspeed=120 12 switch maxspeed=130 13 switch maxspeed= 0.2 0 0 # if bicycle=use_sidepath, then try to prefer the (hopefully!) existing sidepath with a penalty on this highway (only if avoid_path is not set) assign usesidepathpenalty = switch bicycle=use_sidepath switch avoid_path 0 0.5 0 # give a light advantage to highways with a relation cycleroute assign nocycleroute_penalty switch any_cycleroute 0 0.05 assign not_bicycle_designatedpenalty switch bicycle=designated 0 0.1 assign segregated_penalty switch segregated=no 0.5 0 assign footdesignated_penalty switch foot=designated 1 0 assign sum_highwaypenalty add surfacepenalty add tracktypepenalty add trafficpenalty add smoothnesspenalty add maxspeedpenalty add usesidepathpenalty add excludepenalty add nocycleroute_penalty not_bicycle_designatedpenalty # penalties differ when a cycleway is associated to the highway with "cycleway=yes" assign cycleway_surfacepenalty switch cycleway:surface= surfacepenalty # if not specified, same as highway switch cycleway:surface=asphalt 0 switch cycleway:surface=sett 0.3 # behauene Pflastersteine switch cycleway:surface=paved 0.3 # befestigte(harte)Oberflaesche switch cycleway:surface=concrete|paving_stones 0.8 # Beton, Pflastersteine (geschnitzt) switch cycleway:surface=cobblestone|sett 2 # Kopfsteinpflaster switch cycleway:surface=fine_gravel|compacted 4 # Splitt,verdichtete Oberflaesche switch cycleway:surface=gravel 10 # Schotter 0 # unknown value... # to be activated after implementation of #241 #assign cycleway_smoothnesspenalty # switch cycleway:smoothness= smoothnesspenalty # if not specified, same as highway # switch cycleway:smoothness=intermediate 0.3 # switch cycleway:smoothness=bad 1 # switch cycleway:smoothness=very_bad 2 # switch cycleway:smoothness=horrible 4.5 # 0 # temporary... assign cycleway_smoothnesspenalty smoothnesspenalty # temporray same as highway assign sum_cyclewaypenalty add cycleway_surfacepenalty add cycleway_smoothnesspenalty add usesidepathpenalty add nocycleroute_penalty add not_bicycle_designatedpenalty switch any_cycleway 0 # 0 if cycleway exists 10000 # no cycleway assign costfactor add min sum_highwaypenalty sum_cyclewaypenalty switch or highway=proposed highway=abandoned 10000 min 9999 add if ( and ( equal inclination 1 ) mtb_uh_penalty ) then add mtb_uh_penalty uh_difficult_penalty else mtb_sac_penalty add max onewaypenalty accesspenalty add segregated_penalty add footdesignated_penalty switch or highway=motorway highway=motorway_link 10000 switch or highway=trunk highway=trunk_link 30 switch or highway=primary highway=primary_link 2.6 switch or highway=secondary highway=secondary_link 2.5 switch or highway=tertiary highway=tertiary_link 2.4 switch highway=unclassified 1.5 switch highway=pedestrian switch bicycle=yes 3 8 switch highway=steps switch ramp:stroller=yes 10 100 switch route=ferry 11 switch highway=bridleway 31 switch highway=cycleway switch foot=yes 2 1.5 switch highway=living_street 1.5 switch highway=residential switch bicycle_road=yes 1.1 1.5 switch highway=service switch ( or service= service=alley ) 1.1 switch service=driveway 6 11 switch highway=track|road 1.0 switch highway=path switch avoid_path 2 1 switch highway=footway switch bicycle=yes 1.5 4.7 19.9 # 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 23 else if ( highway=primary_link ) then 23 else if ( highway=secondary ) then 22 else if ( highway=secondary_link ) then 22 else if ( highway=tertiary ) then 21 else if ( highway=tertiary_link ) then 21 else if ( highway=residential|living_street ) then 15 else if ( highway=unclassified ) then 8 else if ( highway=service ) then 8 else if ( highway=cycleway ) then 8 else if ( bicycle=designated ) then 8 else if ( highway=track|road|path ) then if or surface=asphalt|paved|concrete|wood|metal tracktype=grade1 then 8 else 6 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|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 highway=residential|living_street|service then true else if ( and highway=track tracktype=grade1 ) then true else false # ... encoded into a bitmask assign classifiermask # add isbadoneway # no voice hint if 1 of the 2 possibilities is badoneway add multiply isgoodoneway 2 add multiply isroundabout 4 add multiply islinktype 8 multiply isgoodforcars 16 ---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 railwaypenalty switch railway= 0 25 # assign signalpenalty switch highway=traffic_signals 99 # switch crossing=traffic_signals 49 0 # note: in case of a "left-turn" at the traffic-signal the penalty is counted twice... assign barrierpenalty switch barrier= 0 switch barrier=gate|swing_gate 50 switch barrier=block|bollard 59 139 assign initialcost # add signalpenalty add railwaypenalty add barrierpenalty switch bikeaccess 0 switch footaccess 300 1000000