Open wolfgang-8 opened 2 years ago
The source road is tagged as vehicle=destination
.
https://www.openstreetmap.org/way/29736602
So the issue is we're turning from a restricted way into another restricted way. According to the current car profile, we only incur a penalty when we turn from a non-restricted way into a restricted way.
I'd need to have a think about the implications, but we probably need to extend this function to understand if the turn between two restricted ways represents a continuation of the same restriction, or an application of a new restriction.
This case seems quite clear as we are changing the restriction type from vehicle=destination
to access=private
, but there might be more subtle cases to consider.
Similarly, the reverse route has the same problem.
Any route to the destination will have to pay the penalty of turning into the restricted destination road. The route via the private service road should have to pay the penalty twice (once for each turn), but it's only paying once (turn onto private road).
Interesting that only car routing is affected. It seems that this logic is implemented multiple times.
The foot profile has the same logic, but it simply prevents access to the private road, as it doesn't support restricted access.
The bicycle profile has removed the logic (#4072), but in any case it also prevents access to the private road too.
So yes, it does seem inconsistent.
The intention of the car profile allowing heavily penalized turns into private roads is that this allows routes where your destination is on the private road, and bypasses the road otherwise (which is the bug here).
It's not clear to me why this logic should only apply to cars. E.g. if you live on a private road, you might also want the walking and cycling modes to route to/from your house.
The intention of the car profile allowing heavily penalized turns into private roads is that this allows routes where your destination is on the private road
This doesn't work either. Perhaps it's part of the initial issue.
The only case where it doesn't work is when the private road is also a service road 😄
Here's an example of where it does work: http://map.project-osrm.org/?z=18¢er=48.360853%2C11.447153&loc=48.360505%2C11.446826&loc=48.360341%2C11.446890&hl=en&alt=0&srv=0
I think this discussion is making it clear that OSRM should document the intended behaviours more clearly. Digging through the profiles isn't feasible for the end user. In addition, we could write tests against the doc, which would help identify bugs such as the above case.
The only case where it doesn't work is when the private road is also a service road 😄
Yes, the little things...!
I think this discussion is making it clear that OSRM should document the intended behaviours more clearly. Digging through the profiles isn't feasible for the end user.
:thumbsup:
Thank's a lot!
Hi @mjjbell just wanted to add one more exemple that I just encountered. The bug is replicable. OSRM https://map.project-osrm.org/?z=17¢er=48.253527%2C16.466301&loc=48.251952%2C16.464525&loc=48.255027%2C16.466542&hl=en&alt=0&srv=0 OSM https://www.openstreetmap.org/way/218429281 Thank you!
In this example OSRM routes cars through a private service road ( https://www.openstreetmap.org/way/278772454 ):
http://map.project-osrm.org/?z=17¢er=48.415665%2C15.640283&loc=48.415719%2C15.639762&loc=48.416976%2C15.639607&hl=en&alt=0&srv=0
Pedestrians and bicycles are routed as expected:
http://map.project-osrm.org/?z=17¢er=48.415665%2C15.640283&loc=48.415719%2C15.639762&loc=48.416976%2C15.639607&hl=en&alt=0&srv=1
http://map.project-osrm.org/?z=17¢er=48.415665%2C15.640283&loc=48.415719%2C15.639762&loc=48.416976%2C15.639607&hl=en&alt=0&srv=2