improve handling of obvious for end-of-road situations
This commit is contained in:
committed by
Patrick Niklaus
parent
a28125ee9a
commit
4629a20fe4
@@ -419,6 +419,20 @@ void collapseTurnAt(std::vector<RouteStep> &steps,
|
||||
current_step.name_id == steps[two_back_index].name_id)
|
||||
{
|
||||
steps[one_back_index].maneuver.instruction.type = TurnType::Continue;
|
||||
|
||||
const auto getBearing = [](bool in, const RouteStep &step)
|
||||
{
|
||||
const auto index =
|
||||
in ? step.intersections.front().in : step.intersections.front().out;
|
||||
return step.intersections.front().bearings[index];
|
||||
};
|
||||
|
||||
// If we Merge onto the same street, we end up with a u-turn in some cases
|
||||
if (bearingsAreReversed(
|
||||
util::bearing::reverseBearing(getBearing(true, one_back_step)),
|
||||
getBearing(false, current_step)))
|
||||
steps[one_back_index].maneuver.instruction.direction_modifier =
|
||||
DirectionModifier::UTurn;
|
||||
}
|
||||
else if (TurnType::Merge == one_back_step.maneuver.instruction.type &&
|
||||
current_step.maneuver.instruction.type !=
|
||||
|
||||
@@ -180,7 +180,9 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
|
||||
I
|
||||
I
|
||||
*/
|
||||
else if (isEndOfRoad(intersection[0], intersection[1], intersection[2]))
|
||||
else if (isEndOfRoad(intersection[0], intersection[1], intersection[2]) &&
|
||||
!isObviousOfTwo(intersection[1], intersection[2]) &&
|
||||
!isObviousOfTwo(intersection[2], intersection[1]))
|
||||
{
|
||||
if (intersection[1].entry_allowed)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user