Repository navigation
fix: closed segments no longer incorrectly remove turn permissions at non-adjacent intersections - #7745
Open
hamishcampbell wants to merge 3 commits into
Open
fix: closed segments no longer incorrectly remove turn permissions at non-adjacent intersections#7745hamishcampbell wants to merge 3 commits into
hamishcampbell wants to merge 3 commits into
Conversation
A zero-speed segment from --segment-speed-file made the customizer drop every turn leaving its edge-based node, so a source anywhere on that node had no way off it, even past the closure (Project-OSRM#7332). Keep those turns, marked with INVALID_EDGE_WEIGHT so cell customization and through traffic still can't use them. In the MLD route, table and matching searches a seed on such a node may leave it when no closed segment lies after the phantom, which the seed weight tells exactly. A source is now valid when its own segment is open. CH still drops the turns, so its behaviour is unchanged.
A target on an edge-based node with a closed (zero-speed) segment before it was invalid outright, so a route to it from a source on the same node past the closure had to leave the node and U-turn back into it from the other side. A phantom is now a valid target, like a source, when its own segment is open. Reaching it from the start of its node would cross the closure, so the searches refuse that instead: a target seed may not be left past a closure before it, and the two sides of a search may only meet at such a seed when the source side entered its node past that closure, which the seed weights tell. This covers the CH and MLD route, table and alternative searches.
With continue_straight, a route that reached a waypoint heading towards a closed (zero-speed) segment on the same edge-based node could not go on, as the node can't be left past the closure, and there is no turn to make before it. Any waypoint after it on the way back failed to route. Treat that like a dead end: when the direction a route reached a waypoint in has a closure ahead, it may carry on from the waypoint in the other direction too, as continue_straight=false always allows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #7332.
When
--segment-speed-filecloses a segment (speed 0), OSRM treats the whole edge-based node holding that segment as unusable. A start or end point on an open part of the same way, past the closure, either can't route at all or has to make a detour. For example, a house on segment A in the issue can't route north even though segment A itself is open.This PR makes routing look at where the phantom sits relative to the closure, rather than only at whether the node has a closure somewhere on it. There are three commits, each one a separate case found & validated through manual testing:
fix(mld): start past a closure. The MLD customizer used to drop every turn leaving a node with a zero-speed segment. It now keeps those turns but marks them
INVALID_EDGE_WEIGHT, so cell customization and through traffic still can't use them. In the MLD route, table and matching searches, a seed on such a node may leave it when no closed segment lies after the phantom (the seed weight shows this exactly). A source is now valid when its own segment is open. CH still drops these turns, so CH behaviour doesn't change for sources.fix(engine): reach a target past a closure along its own edge. A target on a node with a closed segment before it used to be invalid outright, so a route from a source on the same node had to leave the node and U-turn back in from the other side. Now a phantom is a valid target, like a source, when its own segment is open. The searches refuse to reach it from the start of its node across the closure: a target seed can't be left past a closure before it, and the forward and reverse searches can only meet at such a seed when the source side entered the node past the closure. This covers CH and MLD route, table and alternative searches.
fix(engine): turn around at a waypoint heading towards a closure. With
continue_straighta route that reached a waypoint heading towards a closure on the same node had nowhere to go, so the next leg failed. This is now treated like a dead end i.e the route may continue from the waypoint in the other direction, whichcontinue_straight=falsealready allows.Testing
features/testbot/zero-speed-updates.feature:features/testbot/snap_intersection.featurethe b → e and d → a cases in "previous section of segment blocked" used to expectNoRoute. They now route under MLD (new @no_ch scenario). The a → e / e → a cases still giveNoRoute.AI Disclosure
Claude was primarily used to find the fix this issue, alongside manual testing of routes and code review.
Tasklist
update relevant wiki pages(N/A I think)Requirements / Relations
N/A see the source issue #7332