Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.32k stars 3.34k forks source link

Road not routable for default bicycle.lua profile, how to adapt lua profile to allow routing here ? #6100

Open MathiasVersichele opened 3 years ago

MathiasVersichele commented 3 years ago

I'm seeing that the following road doesn't allow routing with the bicycle.lua profile:

https://www.openstreetmap.org/way/23012499

I'm guessing it's related to the "bicycle:conditional" tag ? How can I adapt the lua profile to ignore these temporal restrictions ? Thx!

image
mjjbell commented 3 years ago

Conditional access tags are currently not supported. See #4231 for previous discussion. So the condition is being ignored, but OSRM doesn't process any other tags that grant bicycle access.

If you wanted to handle this in the Lua script, you could update the access hierarchy to include the bicycle:conditional key and then check the access condition value is something you're ok with.

https://github.com/Project-OSRM/osrm-backend/blob/dca35dcc8676df6fa93f491a7b157136918173d5/profiles/bicycle.lua#L81-L85

https://github.com/Project-OSRM/osrm-backend/blob/dca35dcc8676df6fa93f491a7b157136918173d5/profiles/bicycle.lua#L221

https://github.com/Project-OSRM/osrm-backend/blob/dca35dcc8676df6fa93f491a7b157136918173d5/profiles/bicycle.lua#L265

floswald commented 3 years ago

i have a similar question. suppose I live in Milan (italy) and traveling by bike I want to avoid at all costs roads with the tag surface=milanese_paving or surface=cobblestone or surface=cobblestone:flattened like tagged here

Screenshot 2021-08-20 at 10 29 50

is it a terrible hack to just decrease their surface_speed to a very low number here?

https://github.com/Project-OSRM/osrm-backend/blob/dca35dcc8676df6fa93f491a7b157136918173d5/profiles/bicycle.lua#L174

thanks

mjjbell commented 3 years ago

I'm not too familiar with the bicycle profile, but it looks like there is an example of making roads with zero speed inaccessible.

https://github.com/Project-OSRM/osrm-backend/blob/dca35dcc8676df6fa93f491a7b157136918173d5/profiles/bicycle.lua#L302-L304

KirbyJames commented 1 year ago

image I've had a similar problem. I've been using OSRM to 'lock' some bicycle GPX tracks to OSM ways. This works fine for the majority of ways - but it fails to match ways labeled as 'trunk' (in the UK). The image above shows a track locked to the OSM ways except for where it joins the A377 trunk road. If I use the car.lua file it fits correctly. I've modified the bicycle.lua file and added entries for 'trunk' which match the existing 'primary' and 'secondary' ones - but OSRM still fails to match the trunk route. Any idea what I might be doing wrong?

tombay commented 3 months ago

Hi KirbyJames with regard to your problem I have a Pull request open (#PR6703) that addresses the "trunk" issue. Some countries allow bicycle access on trunk roads (including GBR). it might be more than you want https://github.com/Project-OSRM/osrm-backend/pull/6703