-
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
Strange routing, how to avoid routing to the entrance to the building? #5840
Comments
As your target location is not on the road network, it will be snapped to the nearest connected segment for routing, which in this case is the service road to the right of the building. There is logic to avoid snapping to disconnected roads that are not routable between source/target, but in this case the road is connected - setting the main road speed to 0 won't disconnect the service road for snapping purposes, so it continues to attempt to route to that target. Connected component construction occurs during the graph extraction phase, so you will likely need to update OSM data to make this work (i.e. actually mark the road as closed if it's a long-term closure). Alternatively, if the target location is not programmatically set, a marginally small change will lead to snapping to the left service road |
Thank you for your comment. Making changes to the main public OSM map for temporary local needs is not a solution. Keeping and adjusting a copy of the map on the local server or moving destination points - too. Correcting traffic on certain road sections is a very handy tool. Not only in the case of road repair, but also in other cases when it is necessary to influence the routing - for example, the road is closed for the movement of trucks or only a specific entry to the client's territory needs to be used. In my opinion, if there are "disconnected" road sections near the destination, the router should suggest an alternative route along another road within a certain radius from the destination. Then the traffic tool becomes really powerful. For now, as a partial solution, I set the driving speed to 1 kmh. In 99% of cases, routes are laid avoiding such sections of the road, the remaining 1% is considered an acceptable error. At least such sections are not "disconnected" and do not lead to errors in route calculation. The question is closed, thanks. |
I agree it would be useful, somehow the RTree would need to be modifiable from traffic updates. |
What we'd probably want here is to snap to the nearest N neighbours, assign a walking speed for the final section from the snap points to the target coordinate, then perform the shortest path search with the search heaps already populated with those sections. At the moment, the snapping distance has no impact on routing results. This is related to #4465 - OSRM really should seed the search heap with several start points and let the search find the best one, rather than narrowing it down to a single snapping point. |
http://map.project-osrm.org/?z=18¢er=47.088426%2C37.519560&loc=47.089089%2C37.518981&loc=47.088716%2C37.519442&hl=ru&alt=0&srv=0
All roads around are free of barriers or restrictions.
I need a route to be built to any nearest point in the building. How to do it?
I will explain why this is a problem for me. For some reason, this route is the only possible one to this point.
The road on the right is closed for repairs. I simulated this situation on a local server through traffic data, setting the speed to 0 for this section of road.
But now, if I request a route to this point, I get "No route found between points".
I can understand that the route was taken along the road closest to the point of arrival, but why isn't an alternative route suggested after the original route is no longer available?
The text was updated successfully, but these errors were encountered: