Apply formatting

This commit is contained in:
Dennis 2024-05-24 18:48:47 +02:00
parent 76e0364c32
commit 901e488c69
No known key found for this signature in database
GPG Key ID: 6937EAEA33A3FA5D
16 changed files with 87 additions and 116 deletions

View File

@ -11,16 +11,15 @@ namespace osrm::engine::guidance
// Multiple possible reasons can result in unnecessary/confusing instructions // Multiple possible reasons can result in unnecessary/confusing instructions
// Collapsing such turns into a single turn instruction, we give a clearer // Collapsing such turns into a single turn instruction, we give a clearer
// set of instructions that is not cluttered by unnecessary turns/name changes. // set of instructions that is not cluttered by unnecessary turns/name changes.
[[nodiscard]] [[nodiscard]] std::vector<RouteStep> collapseTurnInstructions(std::vector<RouteStep> steps);
std::vector<RouteStep> collapseTurnInstructions(std::vector<RouteStep> steps);
// Multiple possible reasons can result in unnecessary/confusing instructions // Multiple possible reasons can result in unnecessary/confusing instructions
// A prime example would be a segregated intersection. Turning around at this // A prime example would be a segregated intersection. Turning around at this
// intersection would result in two instructions to turn left. // intersection would result in two instructions to turn left.
// Collapsing such turns into a single turn instruction, we give a clearer // Collapsing such turns into a single turn instruction, we give a clearer
// set of instructions that is not cluttered by unnecessary turns/name changes. // set of instructions that is not cluttered by unnecessary turns/name changes.
[[nodiscard]] [[nodiscard]] std::vector<RouteStep>
std::vector<RouteStep> collapseSegregatedTurnInstructions(std::vector<RouteStep> steps); collapseSegregatedTurnInstructions(std::vector<RouteStep> steps);
// A combined turn is a set of two instructions that actually form a single turn, as far as we // A combined turn is a set of two instructions that actually form a single turn, as far as we
// perceive it. A u-turn consisting of two left turns is one such example. But there are also lots // perceive it. A u-turn consisting of two left turns is one such example. But there are also lots

View File

@ -165,8 +165,7 @@ inline bool areSameSide(const RouteStep &lhs, const RouteStep &rhs)
} }
// do this after invalidating any steps to compress the step array again // do this after invalidating any steps to compress the step array again
[[nodiscard]] [[nodiscard]] inline std::vector<RouteStep> removeNoTurnInstructions(std::vector<RouteStep> steps)
inline std::vector<RouteStep> removeNoTurnInstructions(std::vector<RouteStep> steps)
{ {
// finally clean up the post-processed instructions. // finally clean up the post-processed instructions.
// Remove all invalid instructions from the set of instructions. // Remove all invalid instructions from the set of instructions.

View File

@ -13,9 +13,9 @@ namespace osrm::engine::guidance
// we anticipate lane changes emitting only matching lanes early on. // we anticipate lane changes emitting only matching lanes early on.
// the second parameter describes the duration that we feel two segments need to be apart to count // the second parameter describes the duration that we feel two segments need to be apart to count
// as separate maneuvers. // as separate maneuvers.
[[nodiscard]] [[nodiscard]] std::vector<RouteStep>
std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps, anticipateLaneChange(std::vector<RouteStep> steps,
const double min_distance_needed_for_lane_change = 200); const double min_distance_needed_for_lane_change = 200);
} // namespace osrm::engine::guidance } // namespace osrm::engine::guidance

View File

@ -12,8 +12,7 @@ namespace osrm::engine::guidance
{ {
// passed as none-reference to modify in-place and move out again // passed as none-reference to modify in-place and move out again
[[nodiscard]] [[nodiscard]] std::vector<RouteStep> handleRoundabouts(std::vector<RouteStep> steps);
std::vector<RouteStep> handleRoundabouts(std::vector<RouteStep> steps);
// trim initial/final segment of very short length. // trim initial/final segment of very short length.
// This function uses in/out parameter passing to modify both steps and geometry in place. // This function uses in/out parameter passing to modify both steps and geometry in place.
@ -23,23 +22,21 @@ std::vector<RouteStep> handleRoundabouts(std::vector<RouteStep> steps);
void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry); void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry);
// assign relative locations to depart/arrive instructions // assign relative locations to depart/arrive instructions
[[nodiscard]] [[nodiscard]] std::vector<RouteStep> assignRelativeLocations(std::vector<RouteStep> steps,
std::vector<RouteStep> assignRelativeLocations(std::vector<RouteStep> steps, const LegGeometry &geometry,
const LegGeometry &geometry, const PhantomNode &source_node,
const PhantomNode &source_node, const PhantomNode &target_node);
const PhantomNode &target_node);
// collapse suppressed instructions remaining into intersections array // collapse suppressed instructions remaining into intersections array
[[nodiscard]] [[nodiscard]] std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps);
std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps);
// postProcess will break the connection between the leg geometry // postProcess will break the connection between the leg geometry
// for which a segment is supposed to represent exactly the coordinates // for which a segment is supposed to represent exactly the coordinates
// between routing maneuvers and the route steps itself. // between routing maneuvers and the route steps itself.
// If required, we can get both in sync again using this function. // If required, we can get both in sync again using this function.
// Move in LegGeometry for modification in place. // Move in LegGeometry for modification in place.
[[nodiscard]] [[nodiscard]] LegGeometry resyncGeometry(LegGeometry leg_geometry,
LegGeometry resyncGeometry(LegGeometry leg_geometry, const std::vector<RouteStep> &steps); const std::vector<RouteStep> &steps);
/** /**
* Apply maneuver override relations to the selected route. * Apply maneuver override relations to the selected route.

View File

@ -12,8 +12,7 @@ namespace osrm::engine::guidance
// to announce them. All these that are not collapsed into a single turn (think segregated // to announce them. All these that are not collapsed into a single turn (think segregated
// intersection) have to be checked for the length they are active in. If they are active for a // intersection) have to be checked for the length they are active in. If they are active for a
// short distance only, we don't announce them // short distance only, we don't announce them
[[nodiscard]] [[nodiscard]] std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps);
std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps);
} // namespace osrm::engine::guidance } // namespace osrm::engine::guidance

View File

@ -26,17 +26,16 @@ class CoordinateExtractor
* Note: The segment between intersection and turn coordinate can be zero, if the OSM modelling * Note: The segment between intersection and turn coordinate can be zero, if the OSM modelling
* is unfortunate. See https://github.com/Project-OSRM/osrm-backend/issues/3470 * is unfortunate. See https://github.com/Project-OSRM/osrm-backend/issues/3470
*/ */
[[nodiscard]] [[nodiscard]] util::Coordinate
util::Coordinate GetCoordinateAlongRoad(const NodeID intersection_node, GetCoordinateAlongRoad(const NodeID intersection_node,
const EdgeID turn_edge, const EdgeID turn_edge,
const bool traversed_in_reverse, const bool traversed_in_reverse,
const NodeID to_node, const NodeID to_node,
const std::uint8_t number_of_in_lanes) const; const std::uint8_t number_of_in_lanes) const;
// Given a set of precomputed coordinates, select the representative coordinate along the road // Given a set of precomputed coordinates, select the representative coordinate along the road
// that best describes the turn // that best describes the turn
[[nodiscard]] [[nodiscard]] util::Coordinate
util::Coordinate
ExtractRepresentativeCoordinate(const NodeID intersection_node, ExtractRepresentativeCoordinate(const NodeID intersection_node,
const EdgeID turn_edge, const EdgeID turn_edge,
const bool traversed_in_reverse, const bool traversed_in_reverse,
@ -54,20 +53,18 @@ class CoordinateExtractor
// wrapper in case of normal forward edges (traversed_in_reverse = false, to_node = // wrapper in case of normal forward edges (traversed_in_reverse = false, to_node =
// node_based_graph.GetTarget(turn_edge) // node_based_graph.GetTarget(turn_edge)
[[nodiscard]] [[nodiscard]] std::vector<util::Coordinate>
std::vector<util::Coordinate> GetForwardCoordinatesAlongRoad(const NodeID from, GetForwardCoordinatesAlongRoad(const NodeID from, const EdgeID turn_edge) const;
const EdgeID turn_edge) const;
// a less precise way to compute coordinates along a route. Due to the heavy interaction of // a less precise way to compute coordinates along a route. Due to the heavy interaction of
// graph traversal and turn instructions, we often don't care for high precision. We only want // graph traversal and turn instructions, we often don't care for high precision. We only want
// to check for available connections in order, or find (with room for error) the straightmost // to check for available connections in order, or find (with room for error) the straightmost
// turn. This function will offer a bit more error potential but allow for much higher // turn. This function will offer a bit more error potential but allow for much higher
// performance // performance
[[nodiscard]] [[nodiscard]] util::Coordinate GetCoordinateCloseToTurn(const NodeID from_node,
util::Coordinate GetCoordinateCloseToTurn(const NodeID from_node, const EdgeID turn_edge,
const EdgeID turn_edge, const bool traversed_in_reverse,
const bool traversed_in_reverse, const NodeID to_node) const;
const NodeID to_node) const;
/* When extracting the coordinates, we first extract all coordinates. We don't care about most /* When extracting the coordinates, we first extract all coordinates. We don't care about most
* of them, though. * of them, though.
@ -89,22 +86,19 @@ class CoordinateExtractor
* The optional length cache needs to store the accumulated distance up to the respective * The optional length cache needs to store the accumulated distance up to the respective
* coordinate index [0,d(0,1),...] * coordinate index [0,d(0,1),...]
*/ */
[[nodiscard]] [[nodiscard]] std::vector<util::Coordinate>
std::vector<util::Coordinate>
TrimCoordinatesToLength(std::vector<util::Coordinate> coordinates, TrimCoordinatesToLength(std::vector<util::Coordinate> coordinates,
const double desired_length, const double desired_length,
const std::vector<double> &length_cache = {}) const; const std::vector<double> &length_cache = {}) const;
[[nodiscard]] [[nodiscard]] std::vector<double>
std::vector<double> PrepareLengthCache(const std::vector<util::Coordinate> &coordinates, PrepareLengthCache(const std::vector<util::Coordinate> &coordinates, const double limit) const;
const double limit) const;
/* when looking at a set of coordinates, this function allows trimming the vector to a smaller, /* when looking at a set of coordinates, this function allows trimming the vector to a smaller,
* only containing coordinates up to a given distance along the path. The last coordinate might * only containing coordinates up to a given distance along the path. The last coordinate might
* be interpolated * be interpolated
*/ */
[[nodiscard]] [[nodiscard]] std::vector<util::Coordinate>
std::vector<util::Coordinate>
TrimCoordinatesByLengthFront(std::vector<util::Coordinate> coordinates, TrimCoordinatesByLengthFront(std::vector<util::Coordinate> coordinates,
const double desired_length) const; const double desired_length) const;
@ -129,10 +123,9 @@ class CoordinateExtractor
* *
* for fixpoint `b`, vector_base `d` and vector_head `e` * for fixpoint `b`, vector_base `d` and vector_head `e`
*/ */
[[nodiscard]] [[nodiscard]] util::Coordinate GetCorrectedCoordinate(const util::Coordinate fixpoint,
util::Coordinate GetCorrectedCoordinate(const util::Coordinate fixpoint, const util::Coordinate vector_base,
const util::Coordinate vector_base, const util::Coordinate vector_head) const;
const util::Coordinate vector_head) const;
/* generate a uniform vector of coordinates in same range distances /* generate a uniform vector of coordinates in same range distances
* *
@ -142,8 +135,7 @@ class CoordinateExtractor
* Into: * Into:
* x -- x -- x -- x -- x - x * x -- x -- x -- x -- x - x
*/ */
[[nodiscard]] [[nodiscard]] std::vector<util::Coordinate>
std::vector<util::Coordinate>
SampleCoordinates(const std::vector<util::Coordinate> &coordinates, SampleCoordinates(const std::vector<util::Coordinate> &coordinates,
const double length, const double length,
const double rate) const; const double rate) const;

View File

@ -41,18 +41,14 @@ class MotorwayHandler final : public IntersectionHandler
Intersection intersection) const override final; Intersection intersection) const override final;
private: private:
[[nodiscard]] [[nodiscard]] Intersection handleSliproads(const NodeID intersection_node_id,
Intersection handleSliproads(const NodeID intersection_node_id, Intersection intersection) const;
Intersection intersection) const;
[[nodiscard]] [[nodiscard]] Intersection fromMotorway(const EdgeID via_edge, Intersection intersection) const;
Intersection fromMotorway(const EdgeID via_edge, Intersection intersection) const;
[[nodiscard]] [[nodiscard]] Intersection fromRamp(const EdgeID via_edge, Intersection intersection) const;
Intersection fromRamp(const EdgeID via_edge, Intersection intersection) const;
[[nodiscard]] [[nodiscard]] Intersection fallback(Intersection intersection) const;
Intersection fallback(Intersection intersection) const;
}; };
} // namespace osrm::guidance } // namespace osrm::guidance

View File

@ -19,8 +19,7 @@ namespace osrm::extractor::guidance
// will be corrected to left|throught, since the final lane is not drivable. // will be corrected to left|throught, since the final lane is not drivable.
// This is in contrast to a situation with lanes:psv:forward=0 (or not set) where left|through| // This is in contrast to a situation with lanes:psv:forward=0 (or not set) where left|through|
// represents left|through|through // represents left|through|through
[[nodiscard]] [[nodiscard]] inline std::string
inline std::string
trimLaneString(std::string lane_string, std::int32_t count_left, std::int32_t count_right) trimLaneString(std::string lane_string, std::int32_t count_left, std::int32_t count_right)
{ {
if (count_left) if (count_left)
@ -66,8 +65,8 @@ trimLaneString(std::string lane_string, std::int32_t count_left, std::int32_t co
// turn:lanes=left|through|through|right // turn:lanes=left|through|through|right
// vehicle:lanes=yes|yes|no|yes // vehicle:lanes=yes|yes|no|yes
// bicycle:lanes=yes|no|designated|yes // bicycle:lanes=yes|no|designated|yes
[[nodiscard]] [[nodiscard]] inline std::string applyAccessTokens(std::string lane_string,
inline std::string applyAccessTokens(std::string lane_string, const std::string &access_tokens) const std::string &access_tokens)
{ {
using tokenizer = boost::tokenizer<boost::char_separator<char>>; using tokenizer = boost::tokenizer<boost::char_separator<char>>;
boost::char_separator<char> sep("|", "", boost::keep_empty_tokens); boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);

View File

@ -46,13 +46,11 @@ class TurnAnalysis
/* Full Analysis Process for a single node/edge combination. Use with caution, as the process is /* Full Analysis Process for a single node/edge combination. Use with caution, as the process is
* relatively expensive */ * relatively expensive */
[[nodiscard]] [[nodiscard]] Intersection operator()(const NodeID node_prior_to_intersection,
Intersection operator()(const NodeID node_prior_to_intersection, const EdgeID entering_via_edge) const;
const EdgeID entering_via_edge) const;
// Select turn types based on the intersection shape // Select turn types based on the intersection shape
[[nodiscard]] [[nodiscard]] Intersection
Intersection
AssignTurnTypes(const NodeID from_node, AssignTurnTypes(const NodeID from_node,
const EdgeID via_eid, const EdgeID via_eid,
const extractor::intersection::IntersectionView &intersection) const; const extractor::intersection::IntersectionView &intersection) const;

View File

@ -75,20 +75,19 @@ class TurnHandler final : public IntersectionHandler
bool isCompatibleByRoadClass(const Intersection &intersection, const Fork fork) const; bool isCompatibleByRoadClass(const Intersection &intersection, const Fork fork) const;
// Dead end. // Dead end.
[[nodiscard]] [[nodiscard]] Intersection handleOneWayTurn(Intersection intersection) const;
Intersection handleOneWayTurn(Intersection intersection) const;
// Mode Changes, new names... // Mode Changes, new names...
[[nodiscard]] [[nodiscard]] Intersection handleTwoWayTurn(const EdgeID via_edge,
Intersection handleTwoWayTurn(const EdgeID via_edge, Intersection intersection) const; Intersection intersection) const;
// Forks, T intersections and similar // Forks, T intersections and similar
[[nodiscard]] [[nodiscard]] Intersection handleThreeWayTurn(const EdgeID via_edge,
Intersection handleThreeWayTurn(const EdgeID via_edge, Intersection intersection) const; Intersection intersection) const;
// Handling of turns larger then degree three // Handling of turns larger then degree three
[[nodiscard]] [[nodiscard]] Intersection handleComplexTurn(const EdgeID via_edge,
Intersection handleComplexTurn(const EdgeID via_edge, Intersection intersection) const; Intersection intersection) const;
void void
handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const; handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
@ -96,15 +95,13 @@ class TurnHandler final : public IntersectionHandler
// Classification // Classification
std::optional<Fork> findFork(const EdgeID via_edge, Intersection &intersection) const; std::optional<Fork> findFork(const EdgeID via_edge, Intersection &intersection) const;
[[nodiscard]] [[nodiscard]] Intersection assignLeftTurns(const EdgeID via_edge,
Intersection assignLeftTurns(const EdgeID via_edge, Intersection intersection,
Intersection intersection, const std::size_t starting_at) const;
const std::size_t starting_at) const;
[[nodiscard]] [[nodiscard]] Intersection assignRightTurns(const EdgeID via_edge,
Intersection assignRightTurns(const EdgeID via_edge, Intersection intersection,
Intersection intersection, const std::size_t up_to) const;
const std::size_t up_to) const;
}; };
} // namespace osrm::guidance } // namespace osrm::guidance

View File

@ -242,8 +242,7 @@ inline guidance::DirectionModifier::Enum getTurnDirection(const double angle)
} }
// swaps left <-> right modifier types // swaps left <-> right modifier types
[[nodiscard]] [[nodiscard]] inline guidance::DirectionModifier::Enum
inline guidance::DirectionModifier::Enum
mirrorDirectionModifier(const guidance::DirectionModifier::Enum modifier) mirrorDirectionModifier(const guidance::DirectionModifier::Enum modifier)
{ {
const constexpr guidance::DirectionModifier::Enum results[] = { const constexpr guidance::DirectionModifier::Enum results[] = {

View File

@ -7,9 +7,8 @@
namespace osrm::guidance::lanes namespace osrm::guidance::lanes
{ {
[[nodiscard]] [[nodiscard]] LaneDataVector handleNoneValueAtSimpleTurn(LaneDataVector lane_data,
LaneDataVector handleNoneValueAtSimpleTurn(LaneDataVector lane_data, const Intersection &intersection);
const Intersection &intersection);
} // namespace osrm::guidance::lanes } // namespace osrm::guidance::lanes

View File

@ -22,8 +22,8 @@ struct TurnLaneData
using LaneDataVector = std::vector<TurnLaneData>; using LaneDataVector = std::vector<TurnLaneData>;
// convertes a string given in the OSM format into a TurnLaneData vector // convertes a string given in the OSM format into a TurnLaneData vector
[[nodiscard]] [[nodiscard]] LaneDataVector
LaneDataVector laneDataFromDescription(const extractor::TurnLaneDescription &turn_lane_description); laneDataFromDescription(const extractor::TurnLaneDescription &turn_lane_description);
// Locate A Tag in a lane data vector (if multiple tags are set, the first one found is returned) // Locate A Tag in a lane data vector (if multiple tags are set, the first one found is returned)
LaneDataVector::const_iterator findTag(const extractor::TurnLaneType::Mask tag, LaneDataVector::const_iterator findTag(const extractor::TurnLaneType::Mask tag,

View File

@ -67,8 +67,8 @@ class TurnLaneHandler
~TurnLaneHandler(); ~TurnLaneHandler();
[[nodiscard]] [[nodiscard]] Intersection
Intersection assignTurnLanes(const NodeID at, const EdgeID via_edge, Intersection intersection); assignTurnLanes(const NodeID at, const EdgeID via_edge, Intersection intersection);
private: private:
mutable std::atomic<std::size_t> count_handled; mutable std::atomic<std::size_t> count_handled;
@ -107,24 +107,23 @@ class TurnLaneHandler
const Intersection &intersection) const; const Intersection &intersection) const;
// in case of a simple intersection, assign the lane entries // in case of a simple intersection, assign the lane entries
[[nodiscard]] [[nodiscard]] Intersection simpleMatchTuplesToTurns(Intersection intersection,
Intersection simpleMatchTuplesToTurns(Intersection intersection, const LaneDataVector &lane_data,
const LaneDataVector &lane_data, const LaneDescriptionID lane_string_id);
const LaneDescriptionID lane_string_id);
// partition lane data into lane data relevant at current turn and at next turn // partition lane data into lane data relevant at current turn and at next turn
[[nodiscard]] [[nodiscard]] std::pair<TurnLaneHandler::LaneDataVector, TurnLaneHandler::LaneDataVector>
std::pair<TurnLaneHandler::LaneDataVector, TurnLaneHandler::LaneDataVector> partitionLaneData( partitionLaneData(const NodeID at,
const NodeID at, LaneDataVector turn_lane_data, const Intersection &intersection) const; LaneDataVector turn_lane_data,
const Intersection &intersection) const;
// Sliproad turns have a separated lane to the right/left of other depicted lanes. These lanes // Sliproad turns have a separated lane to the right/left of other depicted lanes. These lanes
// are not necessarily separated clearly from the rest of the way. As a result, we combine both // are not necessarily separated clearly from the rest of the way. As a result, we combine both
// lane entries for our output, while performing the matching with the separated lanes only. // lane entries for our output, while performing the matching with the separated lanes only.
[[nodiscard]] [[nodiscard]] Intersection handleSliproadTurn(Intersection intersection,
Intersection handleSliproadTurn(Intersection intersection, const LaneDescriptionID lane_description_id,
const LaneDescriptionID lane_description_id, LaneDataVector lane_data,
LaneDataVector lane_data, const Intersection &previous_intersection);
const Intersection &previous_intersection);
// get the lane data for an intersection // get the lane data for an intersection
void extractLaneData(const EdgeID via_edge, void extractLaneData(const EdgeID via_edge,

View File

@ -33,12 +33,12 @@ findBestMatchForReverse(const extractor::TurnLaneType::Mask leftmost_tag,
bool canMatchTrivially(const Intersection &intersection, const LaneDataVector &lane_data); bool canMatchTrivially(const Intersection &intersection, const LaneDataVector &lane_data);
// perform a trivial match on the turn lanes // perform a trivial match on the turn lanes
[[nodiscard]] [[nodiscard]] Intersection
Intersection triviallyMatchLanesToTurns(Intersection intersection, triviallyMatchLanesToTurns(Intersection intersection,
const LaneDataVector &lane_data, const LaneDataVector &lane_data,
const util::NodeBasedDynamicGraph &node_based_graph, const util::NodeBasedDynamicGraph &node_based_graph,
const LaneDescriptionID lane_string_id, const LaneDescriptionID lane_string_id,
util::guidance::LaneDataIdMap &lane_data_to_id); util::guidance::LaneDataIdMap &lane_data_to_id);
} // namespace osrm::guidance::lanes } // namespace osrm::guidance::lanes

View File

@ -433,8 +433,7 @@ void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_l
} }
// OTHER IMPLEMENTATIONS // OTHER IMPLEMENTATIONS
[[nodiscard]] [[nodiscard]] RouteSteps collapseTurnInstructions(RouteSteps steps)
RouteSteps collapseTurnInstructions(RouteSteps steps)
{ {
// make sure we can safely iterate over all steps (has depart/arrive with TurnType::NoTurn) // make sure we can safely iterate over all steps (has depart/arrive with TurnType::NoTurn)
BOOST_ASSERT(!hasTurnType(steps.front()) && !hasTurnType(steps.back())); BOOST_ASSERT(!hasTurnType(steps.front()) && !hasTurnType(steps.back()));
@ -589,8 +588,7 @@ RouteSteps collapseTurnInstructions(RouteSteps steps)
} }
// OTHER IMPLEMENTATIONS // OTHER IMPLEMENTATIONS
[[nodiscard]] [[nodiscard]] RouteSteps collapseSegregatedTurnInstructions(RouteSteps steps)
RouteSteps collapseSegregatedTurnInstructions(RouteSteps steps)
{ {
// make sure we can safely iterate over all steps (has depart/arrive with TurnType::NoTurn) // make sure we can safely iterate over all steps (has depart/arrive with TurnType::NoTurn)
BOOST_ASSERT(!hasTurnType(steps.front()) && !hasTurnType(steps.back())); BOOST_ASSERT(!hasTurnType(steps.front()) && !hasTurnType(steps.back()));