bcgov / ols-router

BC Advanced Route Planner
https://bcgov.github.io/ols-router/
Apache License 2.0
23 stars 11 forks source link

Route from 1700 Columbia St, Vancouver to 1832 Columbia St, Vancouver takes an unnecessary turn #280

Closed mraross closed 4 years ago

mraross commented 4 years ago

When a waypoint is right at the intersection of a road centreline and the cross-street is one-way, the route will turn onto the one-way instead of going straight through the intersection

mraross commented 4 years ago

from 1700 Columbia St, Vancouver, BC (located right at intersection of one-way cross street) to 1832 Columbia St, Vancouver, BC

image

When the start point is changed to a location inside the block face (e.g., 1702 Columbia St), the route comes out correct:

image

cmhodgson commented 4 years ago

If anything this is a geocoding problem; the closest segment to the geocoded address is the one-way segment, so it has to take that route. The router has no way to know that you meant to start on Columbia street, not on W 1st Ave. But I doubt you can fix this reliably in the geocoder either... If the point is truly exactly on the intersection, then we would need to enhance the router to support routing from that exact intersection point, not a location along a line. ie. route all-ways from the point instead of from the line segment. That is actually a non-trivial change to the routing logic.

The only way that you should get a point exactly at an intersection as a start or end point is if you geocode an intersection address. If we are wanting to properly support routing to/from intersections, we then need to think about how to properly handle the multi-point intersections with 2 or more points representing a single logical intersection (as caused by divided roads and other complex intersections). This would require the router to be able to identify incoming points as intersection points, and also have a complex intersection model linking the points together.

In other words, this opens a whole can of worms.

mraross commented 4 years ago

There is a simple way to deal with this: enhance the address range generator so that it offsets the first number in the block-face to the curb-line of the cross-street, or to put it another way, where the sidewalk starts on the block-face. You might be doing something like that already. Just a little more so even if you cut into the block-face a bit, as long as you don't go past the first known accessPoint? Anyways, not a high-priority item. Just an interesting rare case.