# # enduro-motorcycle profile 7 Base # # This profile tries to focus on dirt roads # ---context:global # following code refers to global config assign turnInstructionMode = 1 assign bike_type = 1 # %bike_type% |Choose your Enduro bike or riding type | [ 1=Rally/Maxi, 2=Enduro, 3=Hard, 4=Scouting ] assign skill_level = 4 # %skill_level% |Choose your skill level | [ 1=Beginner, 2=Intermediate, 3=Advanced, 4=Expert ] assign exclude_skill_level = false # %exclude_skill_level% |Flag to exclude skill level on the compute| boolean assign route_type = 3 # %route_type% |Choose route type to ride | [ 1=Short and Fast, 2=Liaison, 3=Offroad, 4=X-Offroad ] assign allow_gates = 1 # %allow_gates% |Which gates should be allowed? | [ 1=All, 2=Known, 3=None ] assign turnInstructionRoundabouts = true assign turnInstructionCatchingRange = 40 # generate a bike route assign validForBikes = false assign validForCars = true #for Enduro time remaining is more accurate then ValidForBikes assign validForFoot = false assign avoid_ferries = true # %avoid_ferries% |Flag to avoid narrow_gauge/disused railways or ferries| boolean assign increase_ascend = false # %increase_ascend% |Flag to increase total ascend on small or unpaved roads| boolean assign construction_penalty = true # %construction_penalty% |Flag to avoid roads under construction| boolean assign is_wet = true # %is_wet% |Flag to include fords in routes| boolean assign dirt_penalty switch ( equal route_type 1 ) 1 switch ( equal route_type 2 ) 1 switch ( equal route_type 3 ) 5 50 assign mj_rd_penalty switch ( equal route_type 1 ) 1 switch ( equal route_type 2 ) 2 switch ( equal route_type 3 ) 20 550 assign gate_penalty switch ( equal route_type 1 ) 1000 switch ( equal route_type 2 ) 800 switch ( equal route_type 3 ) 0.1 0.1 assign city_penalty switch ( equal route_type 1 ) false switch ( equal route_type 2 ) false switch ( equal route_type 3 ) true true assign highwayclass switch ( equal route_type 1 ) true switch ( equal route_type 2 ) true switch ( equal route_type 3 ) false false assign combo_biketype_skilllevel switch or exclude_skill_level ( equal bike_type 4 ) 0 add bike_type skill_level #assign downhillcost switch equal combo_biketype_skilllevel 0 0.1 # switch equal combo_biketype_skilllevel 2 0.1 # switch equal combo_biketype_skilllevel 3 0.1 # switch equal combo_biketype_skilllevel 4 0.1 # switch equal combo_biketype_skilllevel 5 0.1 # switch equal combo_biketype_skilllevel 6 0.1 # switch equal combo_biketype_skilllevel 7 0.1 0.1 #assign uphillcost switch equal combo_biketype_skilllevel 0 0.1 # switch equal combo_biketype_skilllevel 2 0.1 # switch equal combo_biketype_skilllevel 3 0.1 # switch equal combo_biketype_skilllevel 4 0.1 # switch equal combo_biketype_skilllevel 5 0.1 # switch equal combo_biketype_skilllevel 6 0.1 # switch equal combo_biketype_skilllevel 7 0.1 0.1 # the global elevation parameters assign downhillcost = 0.1 assign downhillcutoff = 0.1 assign uphillcost = 0.1 assign uphillcutoff = 0.1 # elevation filtering parameters (tbd: optimized settings) assign elevationpenaltybuffer = 10 assign elevationmaxbuffer = 10 assign elevationbufferreduce = 0 #turncost assign smoothness_penalty_mi_rd = 0.1 assign smoothness_penalty_mj_rd = 0.1 # ++++++++++++++++++++++++++++++++++++++ some global defines for finetuning assign voiceprio = 2 # 1: all ways have the same prio (max instructions) # 2: mtb prio, more instructions on different small way types assign steps_penalty = 9999 # avoid steps penalty for steps assign ford_penalty = switch is_wet 0 9999 # penalty for fords (you might not want to get your feet wet ;-) ) assign construction_penalty = switch construction_penalty 9999 mj_rd_penalty #penalty for roads in construction # ------------------------------------------- global defines end ---context:way # following code refers to way-tags assign rideable_railway railway=narrow_gauge|disused|abandoned assign norideable_railway not or railway= rideable_railway assign minor_roads = or highway=bridleway|track|cycleway|footway|pedestrian|steps|path tracktype=grade2|grade3|grade4|grade5 assign ispaved = or surface=paved|asphalt|concrete and not minor_roads surface=cobblestone|paving_stones|sett #|unhewn_cobblestone #only locus #|chipseal|brick|unhewn_cobblestone assign isunpaved = not or surface= ispaved assign paved_cycleway = or cycleway:surface=asphalt|paved|concrete and not minor_roads cycleway:surface=cobblestone|paving_stones|sett assign unpaved_cycleway = not or cycleway= paved_cycleway assign major_roads = or not highway= highway=motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|living_street|service|road #------------------------------SMOOTHNESS PENALTY ROAD LEVEL------------------------------ assign sprdl2 and or isunpaved minor_roads or mtb:scale=1|1+|1-|2|2-|2+|3|4|5|6 or mtb:scale:uphill=1|2|3|4|5 or smoothness=very_bad|horrible|very_horrible|impassable or surface=pebblestone|grass|mud|sand|clay incline=3%|-3%|5%|-5%|8%|-8%|10%|-10%|15%|-15%|20%|-20%|25%|-25%|30%|-30% #|rock #only locus #|rocky|rocks #when lookups.dat is update assign sprdl3 and or isunpaved minor_roads or mtb:scale=2|2-|2+|3|4|5|6 or mtb:scale:uphill=2|3|4|5 or smoothness=horrible|very_horrible|impassable incline=8%|-8%|10%|-10%|15%|-15%|20%|-20%|25%|-25%|30%|-30% assign sprdl4 and or isunpaved minor_roads or mtb:scale=3|4|5|6 or mtb:scale:uphill=3|4|5 or smoothness=very_horrible|impassable incline=15%|-15%|20%|-20%|25%|-25%|30%|-30% assign sprdl5 and or isunpaved minor_roads or mtb:scale=4|5|6 or mtb:scale:uphill=4|5 or smoothness=impassable incline=25%|-25%|30%|-30% assign sprdl6 and or isunpaved minor_roads or mtb:scale=5|6 mtb:scale:uphill=5 assign smoothness_penalty_rd = switch ( equal combo_biketype_skilllevel 0 ) 0 switch ( equal combo_biketype_skilllevel 6 ) sprdl6 switch ( equal combo_biketype_skilllevel 5 ) sprdl5 switch ( equal combo_biketype_skilllevel 4 ) sprdl4 switch ( equal combo_biketype_skilllevel 3 ) sprdl3 switch ( equal combo_biketype_skilllevel 2 ) sprdl2 0 assign city_road = highway=residential|living_street # # base penalties for roadtypes # assign city_factor = multiply sub mj_rd_penalty dirt_penalty -0.125 assign rd_penalty = add switch highway=proposed 9999 switch highway=construction construction_penalty 0 switch highwayclass switch highway=motorway|motorway_link mj_rd_penalty switch highway=trunk|trunk_link add mj_rd_penalty multiply city_factor 1 switch highway=primary|primary_link add mj_rd_penalty multiply city_factor 2 switch highway=secondary|secondary_link add mj_rd_penalty multiply city_factor 3 switch highway=tertiary|tertiary_link add mj_rd_penalty multiply city_factor 4 switch highway=unclassified add mj_rd_penalty multiply city_factor 5 switch highway=residential|living_street add mj_rd_penalty multiply city_factor 6 switch highway=road|service add mj_rd_penalty multiply city_factor 7 switch highway=bridleway|track|cycleway|footway|pedestrian|steps|path add mj_rd_penalty multiply sub mj_rd_penalty dirt_penalty -1 switch isunpaved dirt_penalty switch ispaved mj_rd_penalty switch minor_roads dirt_penalty mj_rd_penalty switch isunpaved dirt_penalty switch ispaved mj_rd_penalty switch minor_roads dirt_penalty mj_rd_penalty #-----------------------------------COMPLEX SCORE LEVEL----------------------------------- assign csl4 switch and or isunpaved minor_roads or mtb:scale=0|0+|0-|1|1+|1- or mtb:scale:uphill=1 smoothness=bad|very_bad 4 0 assign csl3 switch and or isunpaved minor_roads or mtb:scale=2|2+|2- or mtb:scale:uphill=2 or smoothness=horrible or surface=mud|sand 3 incline=3%|-3%|5%|-5% 0 #rock #only locus #|rocky|rocks #when lookups.dat is update assign csl2 switch and or isunpaved minor_roads or mtb:scale=3 or mtb:scale:uphill=3 or smoothness=very_horrible incline=8%|-8%|10%|-10% 2 0 assign csl1 switch and or isunpaved minor_roads or mtb:scale=4 or mtb:scale:uphill=4 or smoothness=impassable incline=15%|-15%|20%|-20% 1 0 assign csl05 switch and or isunpaved minor_roads or mtb:scale=5|6 or mtb:scale:uphill=5 incline=25%|-25%|30%|-30% 0.5 0 assign cslx switch or equal bike_type 4 exclude_skill_level 1 0 assign rd_penalty switch cslx rd_penalty switch equal combo_biketype_skilllevel 7 switch csl05 csl05 switch csl1 csl1 switch csl2 csl2 switch csl3 csl3 switch csl4 csl4 rd_penalty switch equal combo_biketype_skilllevel 6 switch csl1 csl1 switch csl2 csl2 switch csl3 csl3 switch csl4 csl4 rd_penalty switch equal combo_biketype_skilllevel 5 switch csl2 multiply csl2 0.25 switch csl3 multiply csl3 0.66666 switch csl4 multiply csl4 0.875 rd_penalty switch equal combo_biketype_skilllevel 4 switch csl3 multiply csl3 0.33333 switch csl4 multiply csl4 0.75 rd_penalty switch equal combo_biketype_skilllevel 3 switch csl4 multiply csl4 0.25 rd_penalty rd_penalty # # implicit access # assign defaultaccess = switch access= true switch or access=no access=private false true # # calculate logical motorbike access # assign motorcycleaccess = if motorcycle= then ( if motor_vehicle= then ( if vehicle= then ( defaultaccess ) else ( if vehicle=private|no then false else true ) ) else ( if motor_vehicle=private|no then false else true ) ) else ( if not motorcycle=private|no then true else false ) # # combine to penalty for access # assign access_penalty = switch motorcycleaccess 0 9999 # # combine additional penaltys which are common for flat, up and down ways # assign misc_penalty = add access_penalty switch ( not ford= ) ford_penalty 0 assign onewaypenalty = switch switch reversedirection=yes switch oneway= junction=roundabout or oneway=yes or oneway=true oneway=1 oneway=-1 9999 0.0 # # now assign the parameters for the routing engine (initialcost, turncost and flat/up/down costfactors) # assign turncost = switch or isunpaved minor_roads smoothness_penalty_mi_rd smoothness_penalty_mj_rd # # assign parameters for turn instruction generation # assign priorityclassifier = if equal voiceprio 1 then 1 else if equal voiceprio 2 then if ( highway=motorway|motorway_link ) then 130 else if ( highway=trunk|trunk_link ) then 110 else if ( highway=primary|primary_link ) then 90 else if ( highway=secondary|secondary_link ) then 70 else if ( highway=tertiary|tertiary_link ) then 60 else if ( highway=unclassified ) then 55 else if ( highway=residential|living_street ) then 50 else if ( highway=service ) then 40 else if ( highway=road ) then 35 else if ( highway=bridleway|track|cycleway ) then 20 else if ( highway=footway|pedestrian|steps|path ) then 5 else 0 else 0 # # costfactor # assign smallwayspenalty switch ( equal bike_type 1 ) 1000000 switch ( and ( equal bike_type 2 ) not or motorcycle=yes motor_vehicle=yes ) 1000000 switch ( and ( equal bike_type 4 ) or motorcycle=yes motor_vehicle=yes ) 1000000 0 assign costfactor = switch and highway= not or route=ferry rideable_railway 100000 switch or minor_roads major_roads min 9999 add switch city_penalty switch city_road mj_rd_penalty 0 0 add switch and or isunpaved minor_roads or equal bike_type 1 or equal bike_type 2 equal bike_type 3 switch smoothness_penalty_rd 9999 0 0 add switch highway=steps|pedestrian|footway steps_penalty 0 add switch highway=cycleway switch or unpaved_cycleway or motorcycle=yes motor_vehicle=yes 0 9999 0 add onewaypenalty add misc_penalty add rd_penalty switch highway=path smallwayspenalty 0 switch or route=ferry rideable_railway switch avoid_ferries 9999 multiply add dirt_penalty mj_rd_penalty 0.5 9999 # Penalize flat ways n times as much assign uphillcostfactor switch and increase_ascend or isunpaved minor_roads 1 costfactor assign downhillcostfactor switch and increase_ascend or isunpaved minor_roads 1 costfactor #assign costfactor switch isunpaved multiply costfactor 10 costfactor #switch isunpaved multiply costfactor 3 costfactor ---context:node # following code refers to node tags assign defaultaccess = ( not access=no|private ) assign motorcycleaccess = if motorcycle= then ( if motor_vehicle= then ( if vehicle= then ( defaultaccess ) else ( not vehicle=private|no ) ) else ( not motor_vehicle=private|no ) ) else ( not motorcycle=private|no ) assign gatepenalty switch ( equal allow_gates 3 ) 1000000 switch ( and ( equal allow_gates 2 ) not motorcycle=yes ) 1000000 gate_penalty assign initialcost = add switch barrier=motorcycle_barrier 9999 0 add switch barrier=gate|lift_gate|swing_gate|kissing_gate|cycle_barrier|chain|fence|block|hampshire_gate|wall|debris|jersey_barrier|barrier|bar|stone|yes gatepenalty 0 #|bollard|chainblock when lookups.dat is update add switch highway=traffic_signals 100 0 switch and motorcycleaccess not highway=elevator switch or not ford= highway=ford multiply 100 ford_penalty 0 1000000