Revert suppressSegregated routing.
This commit is contained in:
		
							parent
							
								
									9eae1de9bc
								
							
						
					
					
						commit
						92c4a228e1
					
				| @ -74,7 +74,7 @@ Feature: Collapse | |||||||
| 
 | 
 | ||||||
|         When I route I should get |         When I route I should get | ||||||
|             | waypoints | route                      | turns                                      | locations | |             | 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 |     Scenario: Segregated Intersection, Cross Belonging to Correct Street | ||||||
|         Given the node map |         Given the node map | ||||||
|  | |||||||
| @ -177,7 +177,6 @@ class RouteAPI : public BaseAPI | |||||||
|                 leg.steps = guidance::anticipateLaneChange(std::move(leg.steps)); |                 leg.steps = guidance::anticipateLaneChange(std::move(leg.steps)); | ||||||
|                 leg.steps = guidance::buildIntersections(std::move(leg.steps)); |                 leg.steps = guidance::buildIntersections(std::move(leg.steps)); | ||||||
|                 leg.steps = guidance::suppressShortNameSegments(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.steps = guidance::assignRelativeLocations(std::move(leg.steps), | ||||||
|                                                               leg_geometry, |                                                               leg_geometry, | ||||||
|                                                               phantoms.source_phantom, |                                                               phantoms.source_phantom, | ||||||
|  | |||||||
| @ -140,8 +140,6 @@ void combineRouteSteps(RouteStep &step_at_turn_location, | |||||||
| // alias for suppressing a step, using CombineRouteStep with NoModificationStrategy only
 | // alias for suppressing a step, using CombineRouteStep with NoModificationStrategy only
 | ||||||
| void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_location); | void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_location); | ||||||
| 
 | 
 | ||||||
| std::vector<RouteStep> suppressSegregated(std::vector<RouteStep> steps); |  | ||||||
| 
 |  | ||||||
| } /* namespace guidance */ | } /* namespace guidance */ | ||||||
| } /* namespace osrm */ | } /* namespace osrm */ | ||||||
| } /* namespace osrm */ | } /* namespace osrm */ | ||||||
|  | |||||||
| @ -165,7 +165,7 @@ inline RouteStep &RouteStep::ElongateBy(const RouteStep &following_step) | |||||||
|                          following_step.intersections.begin(), |                          following_step.intersections.begin(), | ||||||
|                          following_step.intersections.end()); |                          following_step.intersections.end()); | ||||||
| 
 | 
 | ||||||
|     is_segregated = false; |     /// @todo Process is_segregated flag
 | ||||||
| 
 | 
 | ||||||
|     return *this; |     return *this; | ||||||
| } | } | ||||||
|  | |||||||
| @ -165,8 +165,6 @@ void annotatePath(const FacadeT &facade, | |||||||
|         const auto node_id = *node_from;        // edge-based graph node index
 |         const auto node_id = *node_from;        // edge-based graph node index
 | ||||||
|         const auto name_index = facade.GetNameIndex(node_id); |         const auto name_index = facade.GetNameIndex(node_id); | ||||||
|         const bool is_segregated = facade.IsSegregated(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 auto turn_instruction = facade.GetTurnInstructionForEdgeID(turn_id); | ||||||
|         const extractor::TravelMode travel_mode = facade.GetTravelMode(node_id); |         const extractor::TravelMode travel_mode = facade.GetTravelMode(node_id); | ||||||
|         const auto classes = facade.GetClassData(node_id); |         const auto classes = facade.GetClassData(node_id); | ||||||
|  | |||||||
| @ -480,64 +480,6 @@ RouteSteps collapseTurnInstructions(RouteSteps steps) | |||||||
|     return steps; |     return steps; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::vector<RouteStep> suppressSegregated(std::vector<RouteStep> 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 guidance
 | ||||||
| } // namespace engine
 | } // namespace engine
 | ||||||
| } // namespace osrm
 | } // namespace osrm
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user