From aad909965a49d9c9dac6b3e643a3b2024d1bc425 Mon Sep 17 00:00:00 2001 From: Poutnik Date: Mon, 19 Aug 2019 16:57:58 +0200 Subject: [PATCH 1/6] Added avoid_tolls flag with false as default, for easy switch to tollfree variant. --- misc/profiles2/car-fast.brf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/misc/profiles2/car-fast.brf b/misc/profiles2/car-fast.brf index 3914d69..9292fb4 100644 --- a/misc/profiles2/car-fast.brf +++ b/misc/profiles2/car-fast.brf @@ -22,6 +22,7 @@ assign p_standby = 250 # Watt # technical parameters assign validForCars = true +assign avoid_tolls = false #poutnikl push request assign pass1coefficient = 1.3 assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style @@ -177,7 +178,9 @@ assign maxspeed = min maxspeed_implicit min maxspeed_surface maxspeed_tracktype -assign costfactor = if equal maxspeed 0 then 10000 else 0 +#assign costfactor = if equal maxspeed 0 then 10000 else 0 +assign costfactor = if equal maxspeed 0 then 10000 #poutnikl push request + else if and avoid_tolls toll=yes then 9999 else 0 assign minspeed = switch highway=motorway|motorway_link|trunk 75 0 @@ -240,11 +243,11 @@ assign caraccess motorcar=yes|permissive|designated|destination assign initialcost = - + switch and avoid_tolls barrier=toll_booth 1000000 #poutnikl push request switch caraccess 0 1000000 - + assign maxspeed = if or crossing=traffic_signals highway=traffic_signals From 74f475ee3ecb11dc05adf035852f59b1a9aed4e6 Mon Sep 17 00:00:00 2001 From: Poutnik Date: Mon, 19 Aug 2019 17:00:30 +0200 Subject: [PATCH 2/6] Derived from car-fast with avoid_tolls=true --- misc/profiles2/car-fast-tollfree.brf | 259 +++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 misc/profiles2/car-fast-tollfree.brf diff --git a/misc/profiles2/car-fast-tollfree.brf b/misc/profiles2/car-fast-tollfree.brf new file mode 100644 index 0000000..0c1ac59 --- /dev/null +++ b/misc/profiles2/car-fast-tollfree.brf @@ -0,0 +1,259 @@ +# +# Car-Routing based on a kinematic model +# +# Depending on the vmax-parameter (target-speed) +# this can be anything from least-time routing to eco-routing +# +# +---model:btools.router.KinematicModel + +---context:global + +# kinematic parameters + +assign vmax = 160 # kmh +assign recup_efficiency = 0.7 # (ratio) +assign totalweight = 1640 # kg +assign f_roll = 232 # Newton +assign f_air = 0.4 # 0.5*cw*A*rho +assign f_recup = 400 # Newton +assign p_standby = 250 # Watt + +# technical parameters + +assign validForCars = true +assign avoid_tolls = true #poutnikl push request +assign pass1coefficient = 1.3 +assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style + +# classifier constants + +assign classifier_none = 1 +assign classifier_ferry = 2 + + +---context:way # following code refers to way-tags + +# +# calculate logical car access +# +assign caraccess + switch motorcar= + switch motor_vehicle= + switch vehicle= + switch access= + switch highway=motorway|motorway_link 1 + switch highway=trunk|trunk_link 1 + switch highway=primary|primary_link 1 + switch highway=secondary|secondary_link 1 + switch highway=tertiary|tertiary_link 1 + switch highway=unclassified 1 + switch route=ferry 1 + switch highway=residential|living_street 1 + switch highway=service 1 + 0 + access=yes|permissive|designated|destination + vehicle=yes|designated|destination + motor_vehicle=yes|permissive|designated|destination + motorcar=yes|permissive|designated|destination + +assign caraccess_destination + switch motorcar= + switch motor_vehicle= + switch vehicle= + access=destination + vehicle=destination + motor_vehicle=destination + motorcar=destination + +# +# 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 + +assign accessspeedlimit = if caraccess then 999 else 0 + +assign isbadoneway = if reversedirection=yes then ( if oneway= then junction=roundabout else oneway=yes|true|1 ) else oneway=-1 +assign onewayspeedlimit = if isbadoneway then 0 else 999 + +assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link + +assign maxspeed_surface = + switch or surface= surface=paved|asphalt|concrete 999 + switch surface=paving_stones|cobblestone|sett 30 + 2 + +assign maxspeed_tracktype = + switch tracktype= 999 + switch tracktype=grade1 40 + switch tracktype=grade2 5 + 1 + +assign maxspeed_implicit = + switch highway=motorway 999 + switch highway=motorway_link 130 + switch highway=trunk 250 + switch highway=trunk_link 100 + switch highway=primary|primary_link 100 + switch highway=secondary|secondary_link 90 + switch highway=tertiary|tertiary_link 80 + switch highway=unclassified 50 + switch route=ferry 10 + switch highway=bridleway 10 + switch highway=residential|living_street 30 + switch highway=service 30 + switch highway=track|road|path switch tracktype=grade1 30 5 + 0 + +assign maxspeed_forward = + switch maxspeed:forward=50 50 + switch maxspeed:forward=30 30 + switch maxspeed:forward=10 10 + switch maxspeed:forward=20 20 + switch maxspeed:forward=40 40 + switch maxspeed:forward=60 60 + switch maxspeed:forward=70 70 + switch maxspeed:forward=80 80 + switch maxspeed:forward=90 90 + switch maxspeed:forward=100 100 + switch maxspeed:forward=110 110 + switch maxspeed:forward=120 120 + switch maxspeed:forward=130 130 + switch maxspeed:forward=urban 50 + switch maxspeed:forward=rural 100 + 999 + +assign maxspeed_backward = + switch maxspeed:backward=50 50 + switch maxspeed:backward=30 30 + switch maxspeed:backward=10 10 + switch maxspeed:backward=20 20 + switch maxspeed:backward=40 40 + switch maxspeed:backward=60 60 + switch maxspeed:backward=70 70 + switch maxspeed:backward=80 80 + switch maxspeed:backward=90 90 + switch maxspeed:backward=100 100 + switch maxspeed:backward=110 110 + switch maxspeed:backward=120 120 + switch maxspeed:backward=130 130 + switch maxspeed:backward=urban 50 + switch maxspeed:backward=rural 100 + 999 + +assign maxspeed_explicit = + switch maxspeed=50 50 + switch maxspeed=30 30 + switch maxspeed=10 10 + switch maxspeed=20 20 + switch maxspeed=40 40 + switch maxspeed=60 60 + switch maxspeed=70 70 + switch maxspeed=80 80 + switch maxspeed=90 90 + switch maxspeed=100 100 + switch maxspeed=110 110 + switch maxspeed=120 120 + switch maxspeed=130 130 + switch maxspeed=urban 50 + switch maxspeed=rural 100 + if reversedirection=yes then maxspeed_backward else maxspeed_forward + +assign maxspeed = + min onewayspeedlimit + min accessspeedlimit + min maxspeed_explicit + min maxspeed_implicit + min maxspeed_surface maxspeed_tracktype + +#assign costfactor = if equal maxspeed 0 then 10000 else 0 +assign costfactor = if equal maxspeed 0 then 10000 #poutnikl push request + else if and avoid_tolls toll=yes then 9999 else 0 + +assign minspeed = + switch highway=motorway|motorway_link|trunk 75 0 + +# 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 ( highway=residential|living_street ) then 6 + else if ( highway=service ) then 6 + else if ( highway=track ) then if tracktype=grade1 then 4 else 2 + else if ( highway=bridleway|road ) then 2 + else 0 + +# some more classifying bits used for voice hint generation... + +assign isgoodoneway = if reversedirection=yes then oneway=-1 + else if oneway= then junction=roundabout else oneway=yes|true|1 +assign isroundabout = junction=roundabout +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 + add multiply isgoodoneway 2 + add multiply isroundabout 4 + add multiply islinktype 8 + add multiply isgoodforcars 16 + add multiply highway=residential|living_street 32 + multiply caraccess_destination 64 + +---context:node # following code refers to node tags + +# +# calculate logical car access to nodes +# +assign caraccess + switch motorcar= + switch motor_vehicle= + switch vehicle= + switch access= + not barrier=gate|bollard|lift_gate|cycle_barrier + access=yes|permissive|designated|destination + vehicle=yes|permissive|designated|destination + motor_vehicle=yes|permissive|designated|destination + motorcar=yes|permissive|designated|destination + +assign initialcost = + switch and avoid_tolls barrier=toll_booth 1000000 #poutnikl push request + switch caraccess + 0 + 1000000 + +assign maxspeed = + + if or crossing=traffic_signals highway=traffic_signals + then + switch greater way:priorityclassifier 24 5 + switch greater way:priorityclassifier 22 3 + switch greater way:priorityclassifier 20 1 + 0 + else 999 From 48568a076a38b04b554fdaf9444efdefb678d654 Mon Sep 17 00:00:00 2001 From: poutnikl Date: Mon, 9 Sep 2019 10:48:47 +0200 Subject: [PATCH 3/6] Implemented %avoid_toll% Locus dialog parameter to car-fast profile, renamed from avoid_tolls --- misc/profiles2/car-fast-tollfree.brf | 259 --------------------------- misc/profiles2/car-fast.brf | 6 +- 2 files changed, 3 insertions(+), 262 deletions(-) delete mode 100644 misc/profiles2/car-fast-tollfree.brf diff --git a/misc/profiles2/car-fast-tollfree.brf b/misc/profiles2/car-fast-tollfree.brf deleted file mode 100644 index 0c1ac59..0000000 --- a/misc/profiles2/car-fast-tollfree.brf +++ /dev/null @@ -1,259 +0,0 @@ -# -# Car-Routing based on a kinematic model -# -# Depending on the vmax-parameter (target-speed) -# this can be anything from least-time routing to eco-routing -# -# ----model:btools.router.KinematicModel - ----context:global - -# kinematic parameters - -assign vmax = 160 # kmh -assign recup_efficiency = 0.7 # (ratio) -assign totalweight = 1640 # kg -assign f_roll = 232 # Newton -assign f_air = 0.4 # 0.5*cw*A*rho -assign f_recup = 400 # Newton -assign p_standby = 250 # Watt - -# technical parameters - -assign validForCars = true -assign avoid_tolls = true #poutnikl push request -assign pass1coefficient = 1.3 -assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style - -# classifier constants - -assign classifier_none = 1 -assign classifier_ferry = 2 - - ----context:way # following code refers to way-tags - -# -# calculate logical car access -# -assign caraccess - switch motorcar= - switch motor_vehicle= - switch vehicle= - switch access= - switch highway=motorway|motorway_link 1 - switch highway=trunk|trunk_link 1 - switch highway=primary|primary_link 1 - switch highway=secondary|secondary_link 1 - switch highway=tertiary|tertiary_link 1 - switch highway=unclassified 1 - switch route=ferry 1 - switch highway=residential|living_street 1 - switch highway=service 1 - 0 - access=yes|permissive|designated|destination - vehicle=yes|designated|destination - motor_vehicle=yes|permissive|designated|destination - motorcar=yes|permissive|designated|destination - -assign caraccess_destination - switch motorcar= - switch motor_vehicle= - switch vehicle= - access=destination - vehicle=destination - motor_vehicle=destination - motorcar=destination - -# -# 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 - -assign accessspeedlimit = if caraccess then 999 else 0 - -assign isbadoneway = if reversedirection=yes then ( if oneway= then junction=roundabout else oneway=yes|true|1 ) else oneway=-1 -assign onewayspeedlimit = if isbadoneway then 0 else 999 - -assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link - -assign maxspeed_surface = - switch or surface= surface=paved|asphalt|concrete 999 - switch surface=paving_stones|cobblestone|sett 30 - 2 - -assign maxspeed_tracktype = - switch tracktype= 999 - switch tracktype=grade1 40 - switch tracktype=grade2 5 - 1 - -assign maxspeed_implicit = - switch highway=motorway 999 - switch highway=motorway_link 130 - switch highway=trunk 250 - switch highway=trunk_link 100 - switch highway=primary|primary_link 100 - switch highway=secondary|secondary_link 90 - switch highway=tertiary|tertiary_link 80 - switch highway=unclassified 50 - switch route=ferry 10 - switch highway=bridleway 10 - switch highway=residential|living_street 30 - switch highway=service 30 - switch highway=track|road|path switch tracktype=grade1 30 5 - 0 - -assign maxspeed_forward = - switch maxspeed:forward=50 50 - switch maxspeed:forward=30 30 - switch maxspeed:forward=10 10 - switch maxspeed:forward=20 20 - switch maxspeed:forward=40 40 - switch maxspeed:forward=60 60 - switch maxspeed:forward=70 70 - switch maxspeed:forward=80 80 - switch maxspeed:forward=90 90 - switch maxspeed:forward=100 100 - switch maxspeed:forward=110 110 - switch maxspeed:forward=120 120 - switch maxspeed:forward=130 130 - switch maxspeed:forward=urban 50 - switch maxspeed:forward=rural 100 - 999 - -assign maxspeed_backward = - switch maxspeed:backward=50 50 - switch maxspeed:backward=30 30 - switch maxspeed:backward=10 10 - switch maxspeed:backward=20 20 - switch maxspeed:backward=40 40 - switch maxspeed:backward=60 60 - switch maxspeed:backward=70 70 - switch maxspeed:backward=80 80 - switch maxspeed:backward=90 90 - switch maxspeed:backward=100 100 - switch maxspeed:backward=110 110 - switch maxspeed:backward=120 120 - switch maxspeed:backward=130 130 - switch maxspeed:backward=urban 50 - switch maxspeed:backward=rural 100 - 999 - -assign maxspeed_explicit = - switch maxspeed=50 50 - switch maxspeed=30 30 - switch maxspeed=10 10 - switch maxspeed=20 20 - switch maxspeed=40 40 - switch maxspeed=60 60 - switch maxspeed=70 70 - switch maxspeed=80 80 - switch maxspeed=90 90 - switch maxspeed=100 100 - switch maxspeed=110 110 - switch maxspeed=120 120 - switch maxspeed=130 130 - switch maxspeed=urban 50 - switch maxspeed=rural 100 - if reversedirection=yes then maxspeed_backward else maxspeed_forward - -assign maxspeed = - min onewayspeedlimit - min accessspeedlimit - min maxspeed_explicit - min maxspeed_implicit - min maxspeed_surface maxspeed_tracktype - -#assign costfactor = if equal maxspeed 0 then 10000 else 0 -assign costfactor = if equal maxspeed 0 then 10000 #poutnikl push request - else if and avoid_tolls toll=yes then 9999 else 0 - -assign minspeed = - switch highway=motorway|motorway_link|trunk 75 0 - -# 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 ( highway=residential|living_street ) then 6 - else if ( highway=service ) then 6 - else if ( highway=track ) then if tracktype=grade1 then 4 else 2 - else if ( highway=bridleway|road ) then 2 - else 0 - -# some more classifying bits used for voice hint generation... - -assign isgoodoneway = if reversedirection=yes then oneway=-1 - else if oneway= then junction=roundabout else oneway=yes|true|1 -assign isroundabout = junction=roundabout -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 - add multiply isgoodoneway 2 - add multiply isroundabout 4 - add multiply islinktype 8 - add multiply isgoodforcars 16 - add multiply highway=residential|living_street 32 - multiply caraccess_destination 64 - ----context:node # following code refers to node tags - -# -# calculate logical car access to nodes -# -assign caraccess - switch motorcar= - switch motor_vehicle= - switch vehicle= - switch access= - not barrier=gate|bollard|lift_gate|cycle_barrier - access=yes|permissive|designated|destination - vehicle=yes|permissive|designated|destination - motor_vehicle=yes|permissive|designated|destination - motorcar=yes|permissive|designated|destination - -assign initialcost = - switch and avoid_tolls barrier=toll_booth 1000000 #poutnikl push request - switch caraccess - 0 - 1000000 - -assign maxspeed = - - if or crossing=traffic_signals highway=traffic_signals - then - switch greater way:priorityclassifier 24 5 - switch greater way:priorityclassifier 22 3 - switch greater way:priorityclassifier 20 1 - 0 - else 999 diff --git a/misc/profiles2/car-fast.brf b/misc/profiles2/car-fast.brf index 9292fb4..d7fa23f 100644 --- a/misc/profiles2/car-fast.brf +++ b/misc/profiles2/car-fast.brf @@ -22,7 +22,7 @@ assign p_standby = 250 # Watt # technical parameters assign validForCars = true -assign avoid_tolls = false #poutnikl push request +assign avoid_toll = false # %avoid_toll% Avoid toll roads, if possible assign pass1coefficient = 1.3 assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style @@ -180,7 +180,7 @@ assign maxspeed = #assign costfactor = if equal maxspeed 0 then 10000 else 0 assign costfactor = if equal maxspeed 0 then 10000 #poutnikl push request - else if and avoid_tolls toll=yes then 9999 else 0 + else if and avoid_toll toll=yes then 9999 else 0 assign minspeed = switch highway=motorway|motorway_link|trunk 75 0 @@ -243,7 +243,7 @@ assign caraccess motorcar=yes|permissive|designated|destination assign initialcost = - switch and avoid_tolls barrier=toll_booth 1000000 #poutnikl push request + switch and avoid_toll barrier=toll_booth 1000000 #poutnikl push request switch caraccess 0 1000000 From c8981258e9228d3d0952e697101096f2906b01b7 Mon Sep 17 00:00:00 2001 From: poutnikl Date: Mon, 9 Sep 2019 16:18:26 +0200 Subject: [PATCH 4/6] midified comment section, maxspeed, added avoid unpaved/motorways --- misc/profiles2/car-fast-tollfree.brf | 259 --------------------------- 1 file changed, 259 deletions(-) delete mode 100644 misc/profiles2/car-fast-tollfree.brf diff --git a/misc/profiles2/car-fast-tollfree.brf b/misc/profiles2/car-fast-tollfree.brf deleted file mode 100644 index 0c1ac59..0000000 --- a/misc/profiles2/car-fast-tollfree.brf +++ /dev/null @@ -1,259 +0,0 @@ -# -# Car-Routing based on a kinematic model -# -# Depending on the vmax-parameter (target-speed) -# this can be anything from least-time routing to eco-routing -# -# ----model:btools.router.KinematicModel - ----context:global - -# kinematic parameters - -assign vmax = 160 # kmh -assign recup_efficiency = 0.7 # (ratio) -assign totalweight = 1640 # kg -assign f_roll = 232 # Newton -assign f_air = 0.4 # 0.5*cw*A*rho -assign f_recup = 400 # Newton -assign p_standby = 250 # Watt - -# technical parameters - -assign validForCars = true -assign avoid_tolls = true #poutnikl push request -assign pass1coefficient = 1.3 -assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style - -# classifier constants - -assign classifier_none = 1 -assign classifier_ferry = 2 - - ----context:way # following code refers to way-tags - -# -# calculate logical car access -# -assign caraccess - switch motorcar= - switch motor_vehicle= - switch vehicle= - switch access= - switch highway=motorway|motorway_link 1 - switch highway=trunk|trunk_link 1 - switch highway=primary|primary_link 1 - switch highway=secondary|secondary_link 1 - switch highway=tertiary|tertiary_link 1 - switch highway=unclassified 1 - switch route=ferry 1 - switch highway=residential|living_street 1 - switch highway=service 1 - 0 - access=yes|permissive|designated|destination - vehicle=yes|designated|destination - motor_vehicle=yes|permissive|designated|destination - motorcar=yes|permissive|designated|destination - -assign caraccess_destination - switch motorcar= - switch motor_vehicle= - switch vehicle= - access=destination - vehicle=destination - motor_vehicle=destination - motorcar=destination - -# -# 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 - -assign accessspeedlimit = if caraccess then 999 else 0 - -assign isbadoneway = if reversedirection=yes then ( if oneway= then junction=roundabout else oneway=yes|true|1 ) else oneway=-1 -assign onewayspeedlimit = if isbadoneway then 0 else 999 - -assign islinktype = highway=motorway_link|trunk_link|primary_link|secondary_link|tertiary_link - -assign maxspeed_surface = - switch or surface= surface=paved|asphalt|concrete 999 - switch surface=paving_stones|cobblestone|sett 30 - 2 - -assign maxspeed_tracktype = - switch tracktype= 999 - switch tracktype=grade1 40 - switch tracktype=grade2 5 - 1 - -assign maxspeed_implicit = - switch highway=motorway 999 - switch highway=motorway_link 130 - switch highway=trunk 250 - switch highway=trunk_link 100 - switch highway=primary|primary_link 100 - switch highway=secondary|secondary_link 90 - switch highway=tertiary|tertiary_link 80 - switch highway=unclassified 50 - switch route=ferry 10 - switch highway=bridleway 10 - switch highway=residential|living_street 30 - switch highway=service 30 - switch highway=track|road|path switch tracktype=grade1 30 5 - 0 - -assign maxspeed_forward = - switch maxspeed:forward=50 50 - switch maxspeed:forward=30 30 - switch maxspeed:forward=10 10 - switch maxspeed:forward=20 20 - switch maxspeed:forward=40 40 - switch maxspeed:forward=60 60 - switch maxspeed:forward=70 70 - switch maxspeed:forward=80 80 - switch maxspeed:forward=90 90 - switch maxspeed:forward=100 100 - switch maxspeed:forward=110 110 - switch maxspeed:forward=120 120 - switch maxspeed:forward=130 130 - switch maxspeed:forward=urban 50 - switch maxspeed:forward=rural 100 - 999 - -assign maxspeed_backward = - switch maxspeed:backward=50 50 - switch maxspeed:backward=30 30 - switch maxspeed:backward=10 10 - switch maxspeed:backward=20 20 - switch maxspeed:backward=40 40 - switch maxspeed:backward=60 60 - switch maxspeed:backward=70 70 - switch maxspeed:backward=80 80 - switch maxspeed:backward=90 90 - switch maxspeed:backward=100 100 - switch maxspeed:backward=110 110 - switch maxspeed:backward=120 120 - switch maxspeed:backward=130 130 - switch maxspeed:backward=urban 50 - switch maxspeed:backward=rural 100 - 999 - -assign maxspeed_explicit = - switch maxspeed=50 50 - switch maxspeed=30 30 - switch maxspeed=10 10 - switch maxspeed=20 20 - switch maxspeed=40 40 - switch maxspeed=60 60 - switch maxspeed=70 70 - switch maxspeed=80 80 - switch maxspeed=90 90 - switch maxspeed=100 100 - switch maxspeed=110 110 - switch maxspeed=120 120 - switch maxspeed=130 130 - switch maxspeed=urban 50 - switch maxspeed=rural 100 - if reversedirection=yes then maxspeed_backward else maxspeed_forward - -assign maxspeed = - min onewayspeedlimit - min accessspeedlimit - min maxspeed_explicit - min maxspeed_implicit - min maxspeed_surface maxspeed_tracktype - -#assign costfactor = if equal maxspeed 0 then 10000 else 0 -assign costfactor = if equal maxspeed 0 then 10000 #poutnikl push request - else if and avoid_tolls toll=yes then 9999 else 0 - -assign minspeed = - switch highway=motorway|motorway_link|trunk 75 0 - -# 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 ( highway=residential|living_street ) then 6 - else if ( highway=service ) then 6 - else if ( highway=track ) then if tracktype=grade1 then 4 else 2 - else if ( highway=bridleway|road ) then 2 - else 0 - -# some more classifying bits used for voice hint generation... - -assign isgoodoneway = if reversedirection=yes then oneway=-1 - else if oneway= then junction=roundabout else oneway=yes|true|1 -assign isroundabout = junction=roundabout -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 - add multiply isgoodoneway 2 - add multiply isroundabout 4 - add multiply islinktype 8 - add multiply isgoodforcars 16 - add multiply highway=residential|living_street 32 - multiply caraccess_destination 64 - ----context:node # following code refers to node tags - -# -# calculate logical car access to nodes -# -assign caraccess - switch motorcar= - switch motor_vehicle= - switch vehicle= - switch access= - not barrier=gate|bollard|lift_gate|cycle_barrier - access=yes|permissive|designated|destination - vehicle=yes|permissive|designated|destination - motor_vehicle=yes|permissive|designated|destination - motorcar=yes|permissive|designated|destination - -assign initialcost = - switch and avoid_tolls barrier=toll_booth 1000000 #poutnikl push request - switch caraccess - 0 - 1000000 - -assign maxspeed = - - if or crossing=traffic_signals highway=traffic_signals - then - switch greater way:priorityclassifier 24 5 - switch greater way:priorityclassifier 22 3 - switch greater way:priorityclassifier 20 1 - 0 - else 999 From 973dbae703bae7d384003c069afc1098166c0de1 Mon Sep 17 00:00:00 2001 From: poutnikl Date: Mon, 9 Sep 2019 16:30:04 +0200 Subject: [PATCH 5/6] modified comment section, maxspeed, added avoid unpaved/motorways --- misc/profiles2/car-fast.brf | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/misc/profiles2/car-fast.brf b/misc/profiles2/car-fast.brf index d7fa23f..a939a6a 100644 --- a/misc/profiles2/car-fast.brf +++ b/misc/profiles2/car-fast.brf @@ -22,9 +22,12 @@ assign p_standby = 250 # Watt # technical parameters assign validForCars = true -assign avoid_toll = false # %avoid_toll% Avoid toll roads, if possible assign pass1coefficient = 1.3 assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style +assign avoid_toll = 1 # %avoid_toll% | Avoid paid roads | boolean +assign avoid_unpaved = 1 # %avoid_unpaved% | Avoid unpaved roads, if possible | boolean +assign avoid_motorways = 1 # %avoid_motorways% | Avoid motorways | boolean + # classifier constants @@ -34,6 +37,15 @@ assign classifier_ferry = 2 ---context:way # following code refers to way-tags +assign is_avoided_toll_road + and avoid_toll toll=yes + +assign ispaved surface=paved|asphalt|concrete|paving_stones +assign isunpaved not or surface= or ispaved or surface=fine_gravel surface=cobblestone +assign is_avoided_unpaved and avoid_unpaved isunpaved +assign is_avoided_motorway and avoid_motorways highway=motorway + + # # calculate logical car access # @@ -172,15 +184,17 @@ assign maxspeed_explicit = if reversedirection=yes then maxspeed_backward else maxspeed_forward assign maxspeed = + if or is_avoided_toll_road + is_avoided_motorway then 0 + else if is_avoided_unpaved then 4 + else min onewayspeedlimit min accessspeedlimit min maxspeed_explicit min maxspeed_implicit min maxspeed_surface maxspeed_tracktype -#assign costfactor = if equal maxspeed 0 then 10000 else 0 -assign costfactor = if equal maxspeed 0 then 10000 #poutnikl push request - else if and avoid_toll toll=yes then 9999 else 0 +assign costfactor = if equal maxspeed 0 then 10000 else 0 assign minspeed = switch highway=motorway|motorway_link|trunk 75 0 @@ -243,11 +257,11 @@ assign caraccess motorcar=yes|permissive|designated|destination assign initialcost = - switch and avoid_toll barrier=toll_booth 1000000 #poutnikl push request + switch and avoid_toll barrier=toll_booth 1000000 switch caraccess 0 1000000 - + assign maxspeed = if or crossing=traffic_signals highway=traffic_signals From e3dd21499f96cdf6d6ddc041312fdb788b8cd124 Mon Sep 17 00:00:00 2001 From: poutnikl Date: Mon, 9 Sep 2019 17:56:03 +0200 Subject: [PATCH 6/6] backported recent abrench/master/.../car-fast.brf updates --- misc/profiles2/car-fast.brf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/misc/profiles2/car-fast.brf b/misc/profiles2/car-fast.brf index a939a6a..5057438 100644 --- a/misc/profiles2/car-fast.brf +++ b/misc/profiles2/car-fast.brf @@ -49,6 +49,8 @@ assign is_avoided_motorway and avoid_motorways highway=motorway # # calculate logical car access # +assign isresidentialorliving = or highway=residential|living_street living_street=yes + assign caraccess switch motorcar= switch motor_vehicle= @@ -61,7 +63,7 @@ assign caraccess switch highway=tertiary|tertiary_link 1 switch highway=unclassified 1 switch route=ferry 1 - switch highway=residential|living_street 1 + switch isresidentialorliving 1 switch highway=service 1 0 access=yes|permissive|designated|destination @@ -124,7 +126,7 @@ assign maxspeed_implicit = switch highway=unclassified 50 switch route=ferry 10 switch highway=bridleway 10 - switch highway=residential|living_street 30 + switch isresidentialorliving 30 switch highway=service 30 switch highway=track|road|path switch tracktype=grade1 30 5 0 @@ -214,7 +216,7 @@ assign priorityclassifier = else if ( highway=tertiary ) then 22 else if ( highway=tertiary_link ) then 21 else if ( highway=unclassified ) then 20 - else if ( highway=residential|living_street ) then 6 + else if ( isresidentialorliving ) then 6 else if ( highway=service ) then 6 else if ( highway=track ) then if tracktype=grade1 then 4 else 2 else if ( highway=bridleway|road ) then 2 @@ -226,7 +228,7 @@ assign isgoodoneway = if reversedirection=yes then oneway=-1 else if oneway= then junction=roundabout else oneway=yes|true|1 assign isroundabout = junction=roundabout assign isgoodforcars = if greater priorityclassifier 6 then true - else if highway=residential|living_street|service then true + else if or isresidentialorliving highway=service then true else if ( and highway=track tracktype=grade1 ) then true else false @@ -237,7 +239,7 @@ assign classifiermask add isbadoneway add multiply isroundabout 4 add multiply islinktype 8 add multiply isgoodforcars 16 - add multiply highway=residential|living_street 32 + add multiply isresidentialorliving 32 multiply caraccess_destination 64 ---context:node # following code refers to node tags