You have too mild, leaking access restrictions where it was obvious the
access was only for foot or bikes.
I suggest to rebuild it, as allowed bike or foot access does not mean
allowed motorbike access.
You should to follow the motor vehicle access chain.
It would follow the access with decreasing priority
access for motorbikes
then for motor vehicles
then for vehicles
then general/default access
assign defaultaccess =ifaccess=private|no|agricultural
then 0 else 1
assign vehicleaccess = if vehicle=private|no|agricultural
then 0 else if vehicle= then
defaultaccess else 1
assign motor_vehicleaccess = if motor_vehicle=private|no|agricultural
then 0 else if motor_vehicle= then
vehicleaccesselse 1
assign motorcycleaccess = if motorcycle=private|no|agricultural
then 0 else if motorcycle= then
motor_vehicleaccesselse 1
assign accesspenalty = switch motorcycleaccess0 9999
On 06/02/2017 09:37 PM,
bjoern....@gmx.de wrote:
> Hello can anybody help me?
> I would really like brouter to find routes mainly on unpaved dirt tracks which are allowed because I want to ride these tracks with my motor bike which is an enduro.
>
> I changed already the profile file "shortest.brf" for oruxmaps so that the defaultaccess is set to 0 for roads with the attribut access=agriculture but brouter still adds roads which have in openstreetmap access=agriculture to the route. How can I make brouter avoid these routes?
>
> Here is the profile:
>
> ---context:global # following code refers to global config
>
> # the elevation parameters
>
> assign downhillcost 0
> assign downhillcutoff 1.5
> assign uphillcost 0
> assign uphillcutoff 1.5
>
> assign turnInstructionMode = 1 # 0=none, 1=auto-choose, 2=locus-style, 3=osmand-style
> assign validForFoot 1
>
> ---context:way # following code refers to way-tags
>
> 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 turncost 0
>
> assign initialcost switch route=ferry 10000 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 or access=no access=agricultural
> 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
>
> assign accesspenalty switch or bikeaccess footaccess 0 100000
>
> assign costfactor
> add accesspenalty
>
> switch route=ferry 100
>
> switch route=ferry 100
> switch or highway=motorway highway=motorway_link 100000
> switch or highway=proposed highway=abandoned 100000
> switch highway=trunk 100000
> switch highway=trunk_link 100000
> switch highway=primary 100000
> switch highway=primary_link 100000
> switch highway=secondary 2
> switch highway=secondary_link 2
> switch highway=tertiary 2
> switch highway=tertiary_link 2
> switch highway=unclassified 2
> switch highway=residential|living_street 2
> switch highway=service 100000
> switch highway=cycleway 100000
> switch bicycle=designated 100000
> switch highway=track 1
> switch highway=bridleway 100000
> switch highway=road 2
> switch highway=path 100000
> switch highway=footway 100000
> switch highway=steps 100000
> switch highway=pedestrian 100000
> # switch access=0 100000
> switch highway=residential 5
> switch tracktype=grade1 100
> switch tracktype=grade2 50
> switch tracktype=grade3 30
> switch tracktype=grade4 20
> switch tracktype=grade5 1
> # switch tracktype=<no value> 3
> # mtb:scale=<no value> 5
> switch surface=paved 200
> switch surface=asphalt 200
> # switch access=agricultural 100000
> 1
>
> # 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=cycleway ) then 6
> else if ( bicycle=designated ) 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 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 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 access=agricultural
> 1
> 0
>
> 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 initialcost switch defaultaccess 10000000 0
>
--
Poutnik ( The Pilgrim, Der Wanderer )
https://github.com/poutnikl/Brouter-profiles/wiki