switch api format to new structure
This commit is contained in:
@@ -60,10 +60,10 @@ std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
||||
// the current turn lanes constrain the lanes we have to take in the previous turn.
|
||||
util::for_each_pair(rev_first, rev_last, [](RouteStep ¤t, RouteStep &previous) {
|
||||
const auto current_inst = current.maneuver.instruction;
|
||||
const auto current_lanes = current.maneuver.lanes;
|
||||
const auto current_lanes = current.intersections.front().lanes;
|
||||
|
||||
// Constrain the previous turn's lanes
|
||||
auto &previous_lanes = previous.maneuver.lanes;
|
||||
auto &previous_lanes = previous.intersections.front().lanes;
|
||||
// Lane mapping (N:M) from previous lanes (N) to current lanes (M), with:
|
||||
// N > M, N > 1 fan-in situation, constrain N lanes to min(N,M) shared lanes
|
||||
// otherwise nothing to constrain
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "util/guidance/turn_lanes.hpp"
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/numeric/conversion/cast.hpp>
|
||||
#include <boost/range/algorithm_ext/erase.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
@@ -912,8 +913,8 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
|
||||
designated_depart.maneuver.instruction = TurnInstruction::NO_TURN();
|
||||
// we need to make this conform with the intersection format for the first intersection
|
||||
auto &first_intersection = designated_depart.intersections.front();
|
||||
designated_depart.maneuver.lanes = util::guidance::LaneTupel();
|
||||
designated_depart.maneuver.lane_description.clear();
|
||||
designated_depart.intersections.front().lanes = util::guidance::LaneTupel();
|
||||
designated_depart.intersections.front().lane_description.clear();
|
||||
first_intersection.bearings = {first_intersection.bearings[first_intersection.out]};
|
||||
first_intersection.entry = {true};
|
||||
first_intersection.in = Intersection::NO_INDEX;
|
||||
@@ -980,8 +981,8 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
|
||||
next_to_last_step.maneuver.waypoint_type = WaypointType::Arrive;
|
||||
next_to_last_step.maneuver.instruction = TurnInstruction::NO_TURN();
|
||||
next_to_last_step.maneuver.bearing_after = 0;
|
||||
next_to_last_step.maneuver.lanes = util::guidance::LaneTupel();
|
||||
next_to_last_step.maneuver.lane_description.clear();
|
||||
next_to_last_step.intersections.front().lanes = util::guidance::LaneTupel();
|
||||
next_to_last_step.intersections.front().lane_description.clear();
|
||||
BOOST_ASSERT(next_to_last_step.intersections.size() == 1);
|
||||
auto &last_intersection = next_to_last_step.intersections.back();
|
||||
last_intersection.bearings = {last_intersection.bearings[last_intersection.in]};
|
||||
@@ -1178,7 +1179,7 @@ std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps)
|
||||
return false;
|
||||
|
||||
const auto lane_to_the_right = lanes.first_lane_from_the_right + lanes.lanes_in_turn;
|
||||
if (lane_to_the_right < lane_description.size() &&
|
||||
if (lane_to_the_right < boost::numeric_cast<int>(lane_description.size()) &&
|
||||
containsTag(*(lane_description.rbegin() + lane_to_the_right),
|
||||
(extractor::guidance::TurnLaneType::straight |
|
||||
extractor::guidance::TurnLaneType::none)))
|
||||
@@ -1191,7 +1192,8 @@ std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps)
|
||||
{
|
||||
const auto &step = steps[step_index];
|
||||
if (step.maneuver.instruction.type == TurnType::UseLane &&
|
||||
canCollapeUseLane(step.maneuver.lanes, step.maneuver.lane_description))
|
||||
canCollapeUseLane(step.intersections.front().lanes,
|
||||
step.intersections.front().lane_description))
|
||||
{
|
||||
const auto previous = getPreviousIndex(step_index);
|
||||
steps[previous] = elongate(steps[previous], steps[step_index]);
|
||||
|
||||
Reference in New Issue
Block a user