From dd009322de956a3d4fae20dff7474c8b39259b9f Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Wed, 31 May 2017 18:33:14 +0200 Subject: [PATCH] Remove roundabout skip as no leavesRoundabout steps after postProcess --- features/guidance/roundabout.feature | 6 +++--- src/engine/guidance/collapse_turns.cpp | 16 ---------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature index aa0e6fe0f..13fce9343 100644 --- a/features/guidance/roundabout.feature +++ b/features/guidance/roundabout.feature @@ -843,6 +843,6 @@ Feature: Basic Roundabout When I route I should get - | from | to | route | turns | distance | - | e | k | ebds,ebds,ds,ufghl,gi,jhik,jhik | depart,rotary-exit-1,rotary-exit-1,rstur-exit-2,invalid right,turn right,arrive | 189.1m | - | 1 | k | ebds,ds,ufghl,gi,jhik,jhik | depart,rotary-exit-1,rstur-exit-2,invalid right,turn right,arrive | 159.1m | + | from | to | route | turns | distance | + | e | k | ebds,ebds,ds,ufghl,jhik,jhik | depart,rotary-exit-1,rotary-exit-1,rstur-exit-2,turn right,arrive | 189.1m | + | 1 | k | ebds,ds,ufghl,jhik,jhik | depart,rotary-exit-1,rstur-exit-2,turn right,arrive | 159.1m | diff --git a/src/engine/guidance/collapse_turns.cpp b/src/engine/guidance/collapse_turns.cpp index d9b5353a9..e6bc60681 100644 --- a/src/engine/guidance/collapse_turns.cpp +++ b/src/engine/guidance/collapse_turns.cpp @@ -315,22 +315,6 @@ RouteSteps collapseTurnInstructions(RouteSteps steps) if (entersRoundabout(current_step->maneuver.instruction) || staysOnRoundabout(current_step->maneuver.instruction)) { - // Skip over all instructions within the roundabout or check for - // special case from setUpRoundabout of a single Enter{Rotary,..} instruction - auto next_exit_or_enter = - std::find_if(current_step + 1, std::prev(steps.end()), [](const auto &step) { - return leavesRoundabout(step.maneuver.instruction) || - entersRoundabout(step.maneuver.instruction); - }); - - bool is_touching_or_crossing_roundabout = - !leavesRoundabout(next_exit_or_enter->maneuver.instruction) && - current_step->maneuver.exit == 1; - - // If the instruction touches or crosses the roundabout then the current instruction - // is also an exit one otherwise move the current step to the corresponding exit - current_step = is_touching_or_crossing_roundabout ? current_step : next_exit_or_enter; - // are we done for good? if (current_step + 1 == steps.end()) break;