-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router choosing longer route due to taking smallest gap between point and road #5558
Comments
Ultimately this is because OSRM does not support area routing (see #64). |
@systemed sorry, but my issue is not about area routing at all. I have recognized (albeit late!) that it wasn't the real requirement/problem here. I would rather not have OSRM do routing in an area in my use case. The issue is about how OSRM decides which route is best when the destination/origin point is off the road. Let me try and explain it better: Simplified ScenarioProblem StatementPlease see the diagram. So this is how I believe the current decision-making seems to be happening:
So because all the routing decision-making process only begins long after Q has been chosen and P has been rejected, we never get to see Path A even in the alternative path suggestions. Proposed alternative algorithm
Secondary proposalIf we can't reach that level of choosiness, then the least we can do is not discard the P option out of hand and include it in the alternative path suggestions. If it comes at least mentioned as an alternative path in the API callback then I can evaluate the distances and choose the more sensible option at my end. Proverbial CarrotI have a feeling that working on this would benefit the driving and transit directions efforts too. If the car is inside a premises, you want to point it to the better gate, not necessarily the closest one. Or if a commuter needs to take a bus to someplace, then you might want to suggest a better stop even if it's a few meters farther away. Please point to codeAt least let me know where exactly in the code is Q being chosen over P, and maybe I can do some tinkering over there at my own end. Apologies - I'm more into Python than Java at the moment; am not being able to trace it myself. Please just tell me which file / section / function / class is involved in this matter. |
This related to #4465 - OSRM snaps to the nearest edge, and routes from that point only. An alternative approach would be to find the nearest N matches, route from all of them, and come up with a heuristic to select which combination is the most desirable. @emiltin suggested a possible heuristic for this back in #605 (comment) when considering the "which 'bearing' matches the user's request best". There are two major changes that would need to be made:
|
@danpat thanks so much for interpreting this correctly. Please feel free to rename the issue to another appropriate title.
I think the "weight" parameter is quite good. Simply compare weights of all results thrown up and rank as you have been. In my use case I've set One added operation could be:
And A would win. But if somebody's in a forest and all the nearest road nodes are a long distance away, then it might be worthwhile to just get them on to the nearest road first and worry about other things later. For that, the |
This issue seems to be stale. It will be closed in 30 days if no further activity occurs. |
Hello, big thanks to the developers of this project for a fantastic amount of work. I have built osrm-backend for pedestrian routing using profiles/foot.lua , and am running osrm-frontend on it.
Please notice the translucent gap in these screenshots:
What is the offiical / code term for this gap? I want to find a way to prevent the router from choosing much longer go-around routes and tolerate an increased gap instead.
That fits the use case for pedestrian routing : We want them to get into the building/premises with the shortest possible road distance. We don't want to send them running around the building in circles just to have them end up on a road point that is closest possible to the exact lat-lon inside the premises. In the real world, the destination/origin lat-long may be well inside a premises but the commuter will obviously go from/to an entry point. The entry points are marked by the points where the roads touch the polygon of the premises.
My guesswork right now is that the router is first finding the closest road point from the location, and then doing routing. But for pedestrian profile it would make sense to check out multiple points and then choose the one that returns least on-road distance. (I have set
weight_name = 'distance'
in my foot.lua profile to keep distance as priority)Regarding the building in screenshot, I had added
highway=pedestrian
,area=yes
tags to it as per this in the hopes that OSRM would not run around the roads, but it now it's treating the outer walls as paths instead of cuttng across the area. If I can get the gap tolerance increased, then i'll rollback those tags.The text was updated successfully, but these errors were encountered: