fix collapsing into uturns, that aren't u-turns

This commit is contained in:
Moritz Kobitzsch
2017-10-13 17:06:22 +02:00
committed by Patrick Niklaus
parent 8719821363
commit 37774a331a
3 changed files with 30 additions and 3 deletions
@@ -306,7 +306,12 @@ bool suppressedStraightBetweenTurns(const RouteStepIterator step_entering_inters
hasTurnType(*step_leaving_intersection, TurnType::Continue) ||
hasTurnType(*step_leaving_intersection, TurnType::OnRamp));
return both_short_enough && similar_length && correct_types;
const auto total_angle =
totalTurnAngle(*step_entering_intersection, *step_leaving_intersection);
const auto total_angle_is_not_uturn =
(total_angle > NARROW_TURN_ANGLE) && (total_angle < 360 - NARROW_TURN_ANGLE);
return both_short_enough && similar_length && correct_types && total_angle_is_not_uturn;
}
bool maneuverSucceededByNameChange(const RouteStepIterator step_entering_intersection,