Re: ENDURO: motorbike riding on unpaved und bad tracks which are allowed

238 views
Skip to first unread message

Poutnik

unread,
Jun 5, 2017, 9:55:15 AM6/5/17
to osm-android...@googlegroups.com
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

Poutnik

unread,
Jun 5, 2017, 10:05:50 AM6/5/17
to OSM Android bikerouting
Some typos, I have rearranged the code


On 06/05/2017 03:55 PM, Poutnik wrote:
> 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 = if access=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
> vehicleaccess else 1
>
> assign motorcycleaccess = if motorcycle=private|no|agricultural
> then 0 else if motorcycle= then
> motor_vehicleaccess else 1
>
> assign accesspenalty = if motorcycleaccess then 0 else 9999

Poutnik

unread,
Jun 6, 2017, 9:24:23 AM6/6/17
to OSM Android bikerouting
An equivalent, but better as faster is( placed in way context )

assign motorcycleaccess =
if motorcycle=private|no|agricultural then 0
else if not motorcycle= then 1
else if motor_vehicle=private|no|agricultural then 0
else if not motor_vehicle= then 1
else if vehicle=private|no|agricultural then 0
else if not vehicle= then 1
else if access=private|no|agricultural then 0
else 1

assign accesspenalty = if motorcycleaccess then 0 else 10000

giovanni...@gmail.com

unread,
Sep 12, 2018, 10:11:02 AM9/12/18
to OSM Android bikerouting
Hi Poutnik, I would need to know if there is a profile for enduro motorcycles, or wich is the best profile to use with the last one.. thanks

Johannes Millinallinger

unread,
Jun 2, 2019, 7:03:11 AM6/2/19
to OSM Android bikerouting
Hello guys, 

I'm also interested in using brouter for adventure motorcycling, e.g. long-distance travelling on lightweight offroad motorcycles. For now i guess the best idea is just to use one of the bicycle profiles and tweak them to our specifc needs, such as: 

Ignoring the steepness factors relevant for bicycles
Avoiding populated areas if possible due to the noise issue and also since towns and settlements slow you down on a motorcycle
Including an option to avoid roads where motor vehicle access is forbidden

I don't have any experience in coding but I will give it a try. If anyone has any tips for me, those are very welcome. 

Best, 

Joe

Am Montag, 5. Juni 2017 15:55:15 UTC+2 schrieb Poutnik:
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

altoMoto

unread,
Jun 3, 2019, 12:06:16 PM6/3/19
to OSM Android bikerouting
Hallo Joe

What you want to do is not coding, but configuring. First read and try to understand an example for bike, for car and the one above. Next start from one and merge useful aspects from the other ones. Test each change with the brouter web-interface: http://brouter.de/brouter-web.

I would not ignore the steepness factor. If you use negative weights, than you prefer steep routes before flat ones, which means generally more fun riding a dirt bike.

Good luck, Stephan
Reply all
Reply to author
Forward
0 new messages