# # enduro-motorcycle profile 6 Base # # This profile tries to focus on dirt roads # ---context:global # following code refers to global config assign turnInstructionMode = 1 assign allow_gates = 1 # %allow_gates% |Which gates should be allowed? | [1=All, 2=Known, 3=None] assign allow_smallways = 3 # %allow_smallways% |Which path/smallways 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 assign validForFoot = false # Locus nav interface flags assign construction_penalty = true # %construction_penalty% |Flag to avoid roads under construction| boolean assign highwayclass = false # %highwayclass% |Flag to add road types classification instead surface type only, reduce gap between minor and major road| boolean assign city_penalty = false # %city_penalty% |Flag to penalizes crossing residential/living_street| boolean assign light_heavy = true # %light_heavy% |Flag if is an light enduro bike, Unflag if it is heavy| boolean assign wet_feet = true # %wet_feet% |Flag to include fords in routes| boolean assign dirt_penalty = 1 # %dirt_penalty% |Penalty for unpaved and small roads| number assign mj_rd_penalty = 1 # %mj_rd_penalty% |Penalty for paved and major roads| number assign gate_penalty = 0.1 # %gate_penalty% |Penalty for the time spent opening and closing the gates| number # the global elevation parameters assign downhillcost = 0.1 # %Downhillcost% |Downhill cost| number assign downhillcutoff = 0.1 # %Downhillcutoff% |% of slope to be excluded in downhill| number assign uphillcost = 0.1 # %Uphillcost% |Uphill cost| number assign uphillcutoff = 0.1 # %Uphillcutoff% |% of slope to be excluded in uphill| number #assign slope_inc = 1 %slope_inc% |Slope increase coefficient| number #turncost assign smoothness_penalty_mi_rd = 0.1 # %smoothness_penalty_mi_rd%|More straight unpaved roads? increases the value| number assign smoothness_penalty_mj_rd = 0.1 # %smoothness_penalty_mj_rd%|More straight paved roads? increases the value| number # elevation filtering parameters (tbd: optimized settings) assign elevationpenaltybuffer = 10 assign elevationmaxbuffer = 10 assign elevationbufferreduce = 0 # ++++++++++++++++++++++++++++++++++++++ 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 ferry_penalty = 9999 # penalty for ferries assign ford_penalty = switch wet_feet 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 isunpaved = surface=unpaved|compacted|fine_gravel|gravel|pebblestone|ground|dirt|earth|grass|grass_paver|mud|sand|clay|wood #|rocks|rock|rocky to insert when lookups.dat is update assign ispaved = surface=paved|asphalt|concrete assign minor_roads = or highway=bridleway|track|cycleway|footway|pedestrian|steps|path tracktype=grade2|grade3|grade4|grade5 assign major_roads = highway=motorway|motorway_link|trunk|trunk_link assign smoothness_penalty_rd = or smoothness=impassable|very_horrible|horrible or mtb:scale=2|2+|2-|3|4|5|6 mtb:scale:uphill=2|3|4|5 assign smallwayspenalty switch ( equal allow_smallways 3 ) 1000000 switch ( and ( equal allow_smallways 2 ) not motorcycle=yes ) 1000000 0 assign city_factor = -0.125 assign city_road = highway=residential|living_street # classifier constants assign classifier_none = 1 assign classifier_ferry = 2 # # base penalties for roadtypes # 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 multiply sub mj_rd_penalty dirt_penalty city_factor 1 switch highway=primary|primary_link add mj_rd_penalty multiply multiply sub mj_rd_penalty dirt_penalty city_factor 2 switch highway=secondary|secondary_link add mj_rd_penalty multiply multiply sub mj_rd_penalty dirt_penalty city_factor 3 switch highway=tertiary|tertiary_link add mj_rd_penalty multiply multiply sub mj_rd_penalty dirt_penalty city_factor 4 switch highway=unclassified add mj_rd_penalty multiply multiply sub mj_rd_penalty dirt_penalty city_factor 5 switch highway=residential|living_street add mj_rd_penalty multiply multiply sub mj_rd_penalty dirt_penalty city_factor 6 switch highway=road|service add mj_rd_penalty multiply multiply sub mj_rd_penalty dirt_penalty 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 # # implicit access here just from the motorroad tag # (implicit access rules from highway tag handled elsewhere) # assign defaultaccess = switch access= true switch access=no false switch 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 assign isroundabout = junction=roundabout assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link assign isgoodforcars = if ( greater priorityclassifier 30 ) 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 multiply isroundabout 4 add multiply islinktype 8 multiply isgoodforcars 16 # # for any change in initialclassifier, initialcost is added once # assign initialclassifier = switch route=ferry classifier_ferry classifier_none assign initialcost = switch ( equal initialclassifier classifier_ferry ) ferry_penalty 0 # # costfactor for flat terrain # assign costfactor = switch and highway= not route=ferry 100000 min 9999 add switch city_penalty switch city_road multiply -1 multiply multiply sub mj_rd_penalty dirt_penalty city_factor 6 0 0 add switch not light_heavy switch smoothness_penalty_rd 9999 0 0 add switch highway=steps|pedestrian|footway steps_penalty 0 add switch highway=cycleway switch or motorcycle=yes motor_vehicle=yes 0 9999 0 add onewaypenalty add misc_penalty add rd_penalty switch highway=path smallwayspenalty 0 # Penalize flat ways n times as much #assign uphillcostfactor costfactor #assign downhillcostfactor costfactor #assign costfactor multiply costfactor 2 ---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 gatepenalty 0 #|bollard|chainblock to insert 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