diff --git a/features/guidance/collapse.feature b/features/guidance/collapse.feature index f56264682..a1723805a 100644 --- a/features/guidance/collapse.feature +++ b/features/guidance/collapse.feature @@ -74,7 +74,7 @@ Feature: Collapse When I route I should get | waypoints | route | turns | locations | - | a,i | first,third,third | depart,turn sharp left,arrive | a,b,i | + | a,i | first,second,third,third | depart,turn left,turn slight left,arrive | a,b,e,i | Scenario: Segregated Intersection, Cross Belonging to Correct Street Given the node map diff --git a/include/engine/api/route_api.hpp b/include/engine/api/route_api.hpp index 70ce602ef..3f278b9b6 100644 --- a/include/engine/api/route_api.hpp +++ b/include/engine/api/route_api.hpp @@ -177,7 +177,6 @@ class RouteAPI : public BaseAPI leg.steps = guidance::anticipateLaneChange(std::move(leg.steps)); leg.steps = guidance::buildIntersections(std::move(leg.steps)); leg.steps = guidance::suppressShortNameSegments(std::move(leg.steps)); - leg.steps = guidance::suppressSegregated(std::move(leg.steps)); leg.steps = guidance::assignRelativeLocations(std::move(leg.steps), leg_geometry, phantoms.source_phantom, diff --git a/include/engine/guidance/collapse_turns.hpp b/include/engine/guidance/collapse_turns.hpp index 22015fa59..bcdca07d7 100644 --- a/include/engine/guidance/collapse_turns.hpp +++ b/include/engine/guidance/collapse_turns.hpp @@ -140,8 +140,6 @@ void combineRouteSteps(RouteStep &step_at_turn_location, // alias for suppressing a step, using CombineRouteStep with NoModificationStrategy only void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_location); -std::vector suppressSegregated(std::vector steps); - } /* namespace guidance */ } /* namespace osrm */ } /* namespace osrm */ diff --git a/include/engine/guidance/route_step.hpp b/include/engine/guidance/route_step.hpp index bac26d465..d2af0e977 100644 --- a/include/engine/guidance/route_step.hpp +++ b/include/engine/guidance/route_step.hpp @@ -165,7 +165,7 @@ inline RouteStep &RouteStep::ElongateBy(const RouteStep &following_step) following_step.intersections.begin(), following_step.intersections.end()); - is_segregated = false; + /// @todo Process is_segregated flag return *this; } diff --git a/include/engine/routing_algorithms/routing_base.hpp b/include/engine/routing_algorithms/routing_base.hpp index 68fce4ff1..3f50e7387 100644 --- a/include/engine/routing_algorithms/routing_base.hpp +++ b/include/engine/routing_algorithms/routing_base.hpp @@ -165,8 +165,6 @@ void annotatePath(const FacadeT &facade, const auto node_id = *node_from; // edge-based graph node index const auto name_index = facade.GetNameIndex(node_id); const bool is_segregated = facade.IsSegregated(node_id); - if (is_segregated) - util::Log() << "111 Segregated node"; const auto turn_instruction = facade.GetTurnInstructionForEdgeID(turn_id); const extractor::TravelMode travel_mode = facade.GetTravelMode(node_id); const auto classes = facade.GetClassData(node_id); diff --git a/src/engine/guidance/collapse_turns.cpp b/src/engine/guidance/collapse_turns.cpp index 9ea5696df..96eeb6470 100644 --- a/src/engine/guidance/collapse_turns.cpp +++ b/src/engine/guidance/collapse_turns.cpp @@ -480,64 +480,6 @@ RouteSteps collapseTurnInstructions(RouteSteps steps) return steps; } -std::vector suppressSegregated(std::vector steps) -{ - if (steps.size() <= 2) - return steps; - - // start of with no-op - for (auto current_step = steps.begin() + 1; current_step + 1 != steps.end(); ++current_step) - { - /// @todo All the prologue checks are taken from the collapseTurnInstructions function. - /// Factor out to the separate routing when changes will be approved. - - if (entersRoundabout(current_step->maneuver.instruction) || - staysOnRoundabout(current_step->maneuver.instruction)) - { - // If postProcess is called before then all corresponding leavesRoundabout steps are - // removed and the current roundabout step can be ignored by directly proceeding to - // the next step. - // If postProcess is not called before then all steps till the next leavesRoundabout - // step must be skipped to prevent incorrect roundabouts post-processing. - - // are we done for good? - if (current_step + 1 == steps.end()) - break; - else - continue; - } - - // only operate on actual turns - if (!hasTurnType(*current_step)) - continue; - - // don't collapse next step if it is a waypoint alread - const auto next_step = findNextTurn(current_step); - if (hasWaypointType(*next_step)) - break; - - const auto previous_step = findPreviousTurn(current_step); - - // don't collapse anything that does change modes - if (current_step->mode != next_step->mode) - continue; - - if (current_step->is_segregated) - { - /// @todo Need to apply correct combine strategies. - - util::Log() << "222 Segregated node"; - combineRouteSteps(*current_step, - *next_step, - AdjustToCombinedTurnStrategy(*previous_step), - TransferSignageStrategy(), - NoModificationStrategy()); - } - } - - return removeNoTurnInstructions(std::move(steps)); -} - } // namespace guidance } // namespace engine } // namespace osrm