don't detect sliproads at wrong locations, don't emit invalid instructions

This commit is contained in:
Moritz Kobitzsch
2016-09-02 14:06:38 +02:00
parent d3a6b5a77e
commit a0ed70f0a2
4 changed files with 95 additions and 18 deletions
+2 -2
View File
@@ -854,9 +854,9 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
// handle final sliproad
if (steps.size() >= 3 &&
steps[steps.size() - 2].maneuver.instruction.type == TurnType::Sliproad)
steps[getPreviousIndex(steps.size() - 1)].maneuver.instruction.type == TurnType::Sliproad)
{
steps[steps.size() - 2].maneuver.instruction.type = TurnType::Turn;
steps[getPreviousIndex(steps.size() - 1)].maneuver.instruction.type = TurnType::Turn;
}
BOOST_ASSERT(steps.front().intersections.size() >= 1);