fix invalid turn angle in forks

This commit is contained in:
Moritz Kobitzsch 2017-05-23 11:59:08 +02:00
parent d262c4dfaa
commit 9bd2b0deaa
5 changed files with 26 additions and 5 deletions

View File

@ -12,7 +12,8 @@
- .osrm.nodes file was renamed to .nbg_nodes and .ebg_nodes was added
- Guidance
- #4075 Changed counting of exits on service roundabouts
- Bugfixes
- Fixed a copy/paste issue assigning wrong directions in similar turns (left over right)
# 5.7.1
- Bugfixes

View File

@ -1260,3 +1260,22 @@ Feature: Simple Turns
| waypoints | route | turns |
| a,d | Goethe,Fried,Fried | depart,continue left,arrive |
| a,g | Goethe,Fried,Fried | depart,turn right,arrive |
# Conflicting roads (https://www.openstreetmap.org/export#map=19/37.57805/-77.46049)
Scenario: Turning at forklike structure
Given the node map
"""
c d
- - - b - - - a
-
e
"""
And the ways
| nodes | name | oneway | highway |
| abc | foo | no | residential |
| bd | bar | yes | residential |
| eb | some | yes | tertiary_link |
When I route I should get
| waypoints | route | turns |
| a,d | foo,bar,bar | depart,turn slight right,arrive |

View File

@ -145,6 +145,7 @@ IntersectionGenerator::ComputeIntersectionShape(const NodeID node_at_center_of_i
intersection.end(),
makeCompareShapeDataAngleToBearing(base_bearing));
}
return intersection;
}

View File

@ -278,7 +278,7 @@ void IntersectionHandler::assignFork(const EdgeID via_edge,
// right side of fork
if (low_priority_left && !low_priority_right)
right.instruction = {suppressed_right_type, DirectionModifier::SlightLeft};
right.instruction = {suppressed_right_type, DirectionModifier::SlightRight};
else
{
if (low_priority_right && !low_priority_left)

View File

@ -705,9 +705,8 @@ void TurnHandler::handleDistinctConflict(const EdgeID via_edge,
const auto left_classification = node_based_graph.GetEdgeData(left.eid).road_classification;
const auto right_classification =
node_based_graph.GetEdgeData(right.eid).road_classification;
if (canBeSeenAsFork(left_classification, right_classification))
assignFork(via_edge, left, right);
else if (left_classification.GetPriority() > right_classification.GetPriority())
if (left_classification.GetPriority() > right_classification.GetPriority())
{
// FIXME this should possibly know about the actual roads?
// here we don't know about the intersection size. To be on the save side,
@ -726,6 +725,7 @@ void TurnHandler::handleDistinctConflict(const EdgeID via_edge,
right.instruction = {findBasicTurnType(via_edge, right),
DirectionModifier::SlightRight};
}
return;
}
const auto left_type = findBasicTurnType(via_edge, left);
const auto right_type = findBasicTurnType(via_edge, right);