switch api format to new structure
This commit is contained in:
parent
57e3f173d3
commit
41ba20ca9a
@ -2,6 +2,7 @@
|
|||||||
Changes from 5.3.0-rc.3
|
Changes from 5.3.0-rc.3
|
||||||
- Guidance
|
- Guidance
|
||||||
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
- Only announce `use lane` on required turns (not using all lanes to go straight)
|
||||||
|
- Moved `lanes` to the intersection objects. This is BREAKING in relation to other Release Candidates but not with respect to other releases.
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
|
- Fix BREAKING: bug that could result in failure to load 'osrm.icd' files. This breaks the dataformat
|
||||||
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
|
- Fix: bug that results in segfaults when `use lane` instructions are suppressed
|
||||||
|
33
docs/http.md
33
docs/http.md
@ -453,24 +453,28 @@ step.
|
|||||||
"maneuver":{
|
"maneuver":{
|
||||||
"type":"turn",
|
"type":"turn",
|
||||||
"modifier":"right",
|
"modifier":"right",
|
||||||
"lanes":[
|
},
|
||||||
{"indications":["left","straight"], "valid":"false"},
|
|
||||||
{"indications":["right"], "valid":"true"}
|
|
||||||
]},
|
|
||||||
"geometry":"{lu_IypwpAVrAvAdI",
|
"geometry":"{lu_IypwpAVrAvAdI",
|
||||||
"mode":"driving",
|
"mode":"driving",
|
||||||
"intersections":[
|
"intersections":[
|
||||||
{"location":[13.39677,52.54366],
|
{"location":[13.39677,52.54366],
|
||||||
"in":3,
|
"in":3,
|
||||||
"out":1,
|
"out":2,
|
||||||
"bearings":[10,92,184,270],
|
"bearings":[10,92,184,270],
|
||||||
"entry":[false,"true","true"]},
|
"entry":["true","true","true","false"],
|
||||||
|
"lanes":[
|
||||||
|
{"indications":["left","straight"], "valid":"false"},
|
||||||
|
{"indications":["right"], "valid":"true"}
|
||||||
|
]},
|
||||||
{"location":[13.394718,52.543096],
|
{"location":[13.394718,52.543096],
|
||||||
"in":0,
|
"in":0,
|
||||||
"out":2,
|
"out":1,
|
||||||
"bearings":[60,150,240,330],
|
"bearings":[60,240,330],
|
||||||
"entry":["false","true","true","true"]
|
"entry":["false","true","true"]
|
||||||
}
|
"lanes":[
|
||||||
|
{"indications":["straight"], "valid":"true"},
|
||||||
|
{"indications":["right"], "valid":"false"}
|
||||||
|
]}
|
||||||
]}
|
]}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -536,8 +540,7 @@ step.
|
|||||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `roundabout` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
|
| `roundabout` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
|
||||||
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
|
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
|
||||||
|
|
||||||
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the turn location
|
|
||||||
|
|
||||||
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
||||||
|
|
||||||
@ -588,6 +591,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
|
in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for `depart` maneuvers.
|
||||||
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
|
- `out`: index into the bearings/entry array. Used to extract the bearing just after the turn. Namely, The clockwise angle from true north to the
|
||||||
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
|
direction of travel immediately after the maneuver/passing the intersection. The value is not supplied for `arrive` maneuvers.
|
||||||
|
- `lanes`: Array of `Lane` objects that denote the available turn lanes at the turn location
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
```
|
```
|
||||||
@ -597,6 +601,11 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
|||||||
"out":2,
|
"out":2,
|
||||||
"bearings":[60,150,240,330],
|
"bearings":[60,150,240,330],
|
||||||
"entry":["false","true","true","true"]
|
"entry":["false","true","true","true"]
|
||||||
|
"lanes":{
|
||||||
|
"indications": ["left", "straight"],
|
||||||
|
"valid": "false"
|
||||||
|
}
|
||||||
|
]}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -170,9 +170,9 @@ module.exports = function () {
|
|||||||
|
|
||||||
this.lanesList = (instructions) => {
|
this.lanesList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, instruction => {
|
return this.extractInstructionList(instructions, instruction => {
|
||||||
if( 'lanes' in instruction.maneuver )
|
if( 'lanes' in instruction.intersections[0] )
|
||||||
{
|
{
|
||||||
return instruction.maneuver.lanes.map( p => { return (p.indications).join(';') + ':' + p.valid; } ).join(' ');
|
return instruction.intersections[0].lanes.map( p => { return (p.indications).join(';') + ':' + p.valid; } ).join(' ');
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
#define ENGINE_GUIDANCE_ASSEMBLE_STEPS_HPP_
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/travel_mode.hpp"
|
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
|
#include "extractor/travel_mode.hpp"
|
||||||
#include "engine/datafacade/datafacade_base.hpp"
|
#include "engine/datafacade/datafacade_base.hpp"
|
||||||
#include "engine/guidance/leg_geometry.hpp"
|
#include "engine/guidance/leg_geometry.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
@ -72,14 +72,15 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
bearings.second,
|
bearings.second,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
extractor::guidance::TurnInstruction::NO_TURN(),
|
||||||
WaypointType::Depart,
|
WaypointType::Depart,
|
||||||
0,
|
0};
|
||||||
util::guidance::LaneTupel(),
|
|
||||||
{}};
|
|
||||||
Intersection intersection{source_node.location,
|
Intersection intersection{source_node.location,
|
||||||
std::vector<short>({bearings.second}),
|
std::vector<short>({bearings.second}),
|
||||||
std::vector<bool>({true}),
|
std::vector<bool>({true}),
|
||||||
Intersection::NO_INDEX,
|
Intersection::NO_INDEX,
|
||||||
0};
|
0,
|
||||||
|
util::guidance::LaneTupel(),
|
||||||
|
{}};
|
||||||
|
|
||||||
if (leg_data.size() > 0)
|
if (leg_data.size() > 0)
|
||||||
{
|
{
|
||||||
@ -138,6 +139,11 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
intersection.location = facade.GetCoordinateOfNode(path_point.turn_via_node);
|
intersection.location = facade.GetCoordinateOfNode(path_point.turn_via_node);
|
||||||
intersection.bearings.clear();
|
intersection.bearings.clear();
|
||||||
intersection.bearings.reserve(bearing_class.getAvailableBearings().size());
|
intersection.bearings.reserve(bearing_class.getAvailableBearings().size());
|
||||||
|
intersection.lanes = path_point.lane_data.first;
|
||||||
|
intersection.lane_description =
|
||||||
|
path_point.lane_data.second != INVALID_LANE_DESCRIPTIONID
|
||||||
|
? facade.GetTurnDescription(path_point.lane_data.second)
|
||||||
|
: extractor::guidance::TurnLaneDescription();
|
||||||
std::copy(bearing_class.getAvailableBearings().begin(),
|
std::copy(bearing_class.getAvailableBearings().begin(),
|
||||||
bearing_class.getAvailableBearings().end(),
|
bearing_class.getAvailableBearings().end(),
|
||||||
std::back_inserter(intersection.bearings));
|
std::back_inserter(intersection.bearings));
|
||||||
@ -151,11 +157,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
bearings.second,
|
bearings.second,
|
||||||
path_point.turn_instruction,
|
path_point.turn_instruction,
|
||||||
WaypointType::None,
|
WaypointType::None,
|
||||||
0,
|
0};
|
||||||
path_point.lane_data.first,
|
|
||||||
(path_point.lane_data.second != INVALID_LANE_DESCRIPTIONID
|
|
||||||
? facade.GetTurnDescription(path_point.lane_data.second)
|
|
||||||
: extractor::guidance::TurnLaneDescription())};
|
|
||||||
segment_index++;
|
segment_index++;
|
||||||
segment_duration = 0;
|
segment_duration = 0;
|
||||||
}
|
}
|
||||||
@ -210,15 +212,16 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
bearings.second,
|
bearings.second,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
extractor::guidance::TurnInstruction::NO_TURN(),
|
||||||
WaypointType::Arrive,
|
WaypointType::Arrive,
|
||||||
0,
|
0};
|
||||||
util::guidance::LaneTupel(),
|
|
||||||
{}};
|
|
||||||
intersection = {
|
intersection = {
|
||||||
target_node.location,
|
target_node.location,
|
||||||
std::vector<short>({static_cast<short>(util::bearing::reverseBearing(bearings.first))}),
|
std::vector<short>({static_cast<short>(util::bearing::reverseBearing(bearings.first))}),
|
||||||
std::vector<bool>({true}),
|
std::vector<bool>({true}),
|
||||||
0,
|
0,
|
||||||
Intersection::NO_INDEX};
|
Intersection::NO_INDEX,
|
||||||
|
util::guidance::LaneTupel(),
|
||||||
|
{}};
|
||||||
|
|
||||||
BOOST_ASSERT(!leg_geometry.locations.empty());
|
BOOST_ASSERT(!leg_geometry.locations.empty());
|
||||||
steps.push_back(RouteStep{target_node.name_id,
|
steps.push_back(RouteStep{target_node.name_id,
|
||||||
@ -243,9 +246,9 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
|||||||
BOOST_ASSERT(steps.back().intersections.front().bearings.size() == 1);
|
BOOST_ASSERT(steps.back().intersections.front().bearings.size() == 1);
|
||||||
BOOST_ASSERT(steps.back().intersections.front().entry.size() == 1);
|
BOOST_ASSERT(steps.back().intersections.front().entry.size() == 1);
|
||||||
BOOST_ASSERT(steps.back().maneuver.waypoint_type == WaypointType::Arrive);
|
BOOST_ASSERT(steps.back().maneuver.waypoint_type == WaypointType::Arrive);
|
||||||
BOOST_ASSERT(steps.back().maneuver.lanes.lanes_in_turn == 0);
|
BOOST_ASSERT(steps.back().intersections.front().lanes.lanes_in_turn == 0);
|
||||||
BOOST_ASSERT(steps.back().maneuver.lanes.first_lane_from_the_right == INVALID_LANEID);
|
BOOST_ASSERT(steps.back().intersections.front().lanes.first_lane_from_the_right == INVALID_LANEID);
|
||||||
BOOST_ASSERT(steps.back().maneuver.lane_description.empty());
|
BOOST_ASSERT(steps.back().intersections.front().lane_description.empty());
|
||||||
return steps;
|
return steps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
#include "util/guidance/bearing_class.hpp"
|
#include "util/guidance/bearing_class.hpp"
|
||||||
#include "util/guidance/entry_class.hpp"
|
#include "util/guidance/entry_class.hpp"
|
||||||
|
|
||||||
|
#include "extractor/guidance/turn_lane_types.hpp"
|
||||||
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -34,6 +37,10 @@ struct Intersection
|
|||||||
std::vector<bool> entry;
|
std::vector<bool> entry;
|
||||||
std::size_t in;
|
std::size_t in;
|
||||||
std::size_t out;
|
std::size_t out;
|
||||||
|
|
||||||
|
// turn lane information
|
||||||
|
util::guidance::LaneTupel lanes;
|
||||||
|
extractor::guidance::TurnLaneDescription lane_description;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline Intersection getInvalidIntersection()
|
inline Intersection getInvalidIntersection()
|
||||||
@ -42,7 +49,9 @@ inline Intersection getInvalidIntersection()
|
|||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
Intersection::NO_INDEX,
|
Intersection::NO_INDEX,
|
||||||
Intersection::NO_INDEX};
|
Intersection::NO_INDEX,
|
||||||
|
util::guidance::LaneTupel(),
|
||||||
|
{}};
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RouteStep
|
struct RouteStep
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
#define ENGINE_GUIDANCE_STEP_MANEUVER_HPP
|
#define ENGINE_GUIDANCE_STEP_MANEUVER_HPP
|
||||||
|
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/guidance/turn_lane_types.hpp"
|
|
||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/guidance/turn_lanes.hpp"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -33,9 +31,6 @@ struct StepManeuver
|
|||||||
|
|
||||||
WaypointType waypoint_type;
|
WaypointType waypoint_type;
|
||||||
unsigned exit;
|
unsigned exit;
|
||||||
|
|
||||||
util::guidance::LaneTupel lanes;
|
|
||||||
extractor::guidance::TurnLaneDescription lane_description;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline StepManeuver getInvalidStepManeuver()
|
inline StepManeuver getInvalidStepManeuver()
|
||||||
@ -45,9 +40,7 @@ inline StepManeuver getInvalidStepManeuver()
|
|||||||
0,
|
0,
|
||||||
extractor::guidance::TurnInstruction::NO_TURN(),
|
extractor::guidance::TurnInstruction::NO_TURN(),
|
||||||
WaypointType::None,
|
WaypointType::None,
|
||||||
0,
|
0};
|
||||||
util::guidance::LaneTupel(),
|
|
||||||
{}};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace guidance
|
} // namespace guidance
|
||||||
|
@ -61,9 +61,9 @@ inline bool isValidModifier(const guidance::StepManeuver maneuver)
|
|||||||
maneuver.instruction.direction_modifier != DirectionModifier::UTurn);
|
maneuver.instruction.direction_modifier != DirectionModifier::UTurn);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool hasValidLanes(const guidance::StepManeuver maneuver)
|
inline bool hasValidLanes(const guidance::Intersection &intersection)
|
||||||
{
|
{
|
||||||
return maneuver.lanes.lanes_in_turn > 0;
|
return intersection.lanes.lanes_in_turn > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string instructionTypeToString(const TurnType::Enum type)
|
std::string instructionTypeToString(const TurnType::Enum type)
|
||||||
@ -71,19 +71,19 @@ std::string instructionTypeToString(const TurnType::Enum type)
|
|||||||
return turn_type_names[static_cast<std::size_t>(type)];
|
return turn_type_names[static_cast<std::size_t>(type)];
|
||||||
}
|
}
|
||||||
|
|
||||||
util::json::Array lanesFromManeuver(const guidance::StepManeuver &maneuver)
|
util::json::Array lanesFromIntersection(const guidance::Intersection &intersection)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(maneuver.lanes.lanes_in_turn >= 1);
|
BOOST_ASSERT(intersection.lanes.lanes_in_turn >= 1);
|
||||||
util::json::Array result;
|
util::json::Array result;
|
||||||
LaneID lane_id = maneuver.lane_description.size();
|
LaneID lane_id = intersection.lane_description.size();
|
||||||
|
|
||||||
for (const auto &lane_desc : maneuver.lane_description)
|
for (const auto &lane_desc : intersection.lane_description)
|
||||||
{
|
{
|
||||||
--lane_id;
|
--lane_id;
|
||||||
util::json::Object lane;
|
util::json::Object lane;
|
||||||
lane.values["indications"] = extractor::guidance::TurnLaneType::toJsonArray(lane_desc);
|
lane.values["indications"] = extractor::guidance::TurnLaneType::toJsonArray(lane_desc);
|
||||||
if (lane_id >= maneuver.lanes.first_lane_from_the_right &&
|
if (lane_id >= intersection.lanes.first_lane_from_the_right &&
|
||||||
lane_id < maneuver.lanes.first_lane_from_the_right + maneuver.lanes.lanes_in_turn)
|
lane_id < intersection.lanes.first_lane_from_the_right + intersection.lanes.lanes_in_turn)
|
||||||
lane.values["valid"] = util::json::True();
|
lane.values["valid"] = util::json::True();
|
||||||
else
|
else
|
||||||
lane.values["valid"] = util::json::False();
|
lane.values["valid"] = util::json::False();
|
||||||
@ -175,9 +175,6 @@ util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver)
|
|||||||
step_maneuver.values["modifier"] =
|
step_maneuver.values["modifier"] =
|
||||||
detail::instructionModifierToString(maneuver.instruction.direction_modifier);
|
detail::instructionModifierToString(maneuver.instruction.direction_modifier);
|
||||||
|
|
||||||
if (detail::hasValidLanes(maneuver))
|
|
||||||
step_maneuver.values["lanes"] = detail::lanesFromManeuver(maneuver);
|
|
||||||
|
|
||||||
step_maneuver.values["location"] = detail::coordinateToLonLat(maneuver.location);
|
step_maneuver.values["location"] = detail::coordinateToLonLat(maneuver.location);
|
||||||
step_maneuver.values["bearing_before"] = std::round(maneuver.bearing_before);
|
step_maneuver.values["bearing_before"] = std::round(maneuver.bearing_before);
|
||||||
step_maneuver.values["bearing_after"] = std::round(maneuver.bearing_after);
|
step_maneuver.values["bearing_after"] = std::round(maneuver.bearing_after);
|
||||||
@ -217,6 +214,9 @@ util::json::Object makeIntersection(const guidance::Intersection &intersection)
|
|||||||
if (intersection.out != guidance::Intersection::NO_INDEX)
|
if (intersection.out != guidance::Intersection::NO_INDEX)
|
||||||
result.values["out"] = intersection.out;
|
result.values["out"] = intersection.out;
|
||||||
|
|
||||||
|
if (detail::hasValidLanes(intersection))
|
||||||
|
result.values["lanes"] = detail::lanesFromIntersection(intersection);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
// 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) {
|
util::for_each_pair(rev_first, rev_last, [](RouteStep ¤t, RouteStep &previous) {
|
||||||
const auto current_inst = current.maneuver.instruction;
|
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
|
// 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:
|
// 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
|
// N > M, N > 1 fan-in situation, constrain N lanes to min(N,M) shared lanes
|
||||||
// otherwise nothing to constrain
|
// otherwise nothing to constrain
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "util/guidance/turn_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/numeric/conversion/cast.hpp>
|
||||||
#include <boost/range/algorithm_ext/erase.hpp>
|
#include <boost/range/algorithm_ext/erase.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -912,8 +913,8 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
|
|||||||
designated_depart.maneuver.instruction = TurnInstruction::NO_TURN();
|
designated_depart.maneuver.instruction = TurnInstruction::NO_TURN();
|
||||||
// we need to make this conform with the intersection format for the first intersection
|
// we need to make this conform with the intersection format for the first intersection
|
||||||
auto &first_intersection = designated_depart.intersections.front();
|
auto &first_intersection = designated_depart.intersections.front();
|
||||||
designated_depart.maneuver.lanes = util::guidance::LaneTupel();
|
designated_depart.intersections.front().lanes = util::guidance::LaneTupel();
|
||||||
designated_depart.maneuver.lane_description.clear();
|
designated_depart.intersections.front().lane_description.clear();
|
||||||
first_intersection.bearings = {first_intersection.bearings[first_intersection.out]};
|
first_intersection.bearings = {first_intersection.bearings[first_intersection.out]};
|
||||||
first_intersection.entry = {true};
|
first_intersection.entry = {true};
|
||||||
first_intersection.in = Intersection::NO_INDEX;
|
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.waypoint_type = WaypointType::Arrive;
|
||||||
next_to_last_step.maneuver.instruction = TurnInstruction::NO_TURN();
|
next_to_last_step.maneuver.instruction = TurnInstruction::NO_TURN();
|
||||||
next_to_last_step.maneuver.bearing_after = 0;
|
next_to_last_step.maneuver.bearing_after = 0;
|
||||||
next_to_last_step.maneuver.lanes = util::guidance::LaneTupel();
|
next_to_last_step.intersections.front().lanes = util::guidance::LaneTupel();
|
||||||
next_to_last_step.maneuver.lane_description.clear();
|
next_to_last_step.intersections.front().lane_description.clear();
|
||||||
BOOST_ASSERT(next_to_last_step.intersections.size() == 1);
|
BOOST_ASSERT(next_to_last_step.intersections.size() == 1);
|
||||||
auto &last_intersection = next_to_last_step.intersections.back();
|
auto &last_intersection = next_to_last_step.intersections.back();
|
||||||
last_intersection.bearings = {last_intersection.bearings[last_intersection.in]};
|
last_intersection.bearings = {last_intersection.bearings[last_intersection.in]};
|
||||||
@ -1178,7 +1179,7 @@ std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto lane_to_the_right = lanes.first_lane_from_the_right + lanes.lanes_in_turn;
|
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),
|
containsTag(*(lane_description.rbegin() + lane_to_the_right),
|
||||||
(extractor::guidance::TurnLaneType::straight |
|
(extractor::guidance::TurnLaneType::straight |
|
||||||
extractor::guidance::TurnLaneType::none)))
|
extractor::guidance::TurnLaneType::none)))
|
||||||
@ -1191,7 +1192,8 @@ std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps)
|
|||||||
{
|
{
|
||||||
const auto &step = steps[step_index];
|
const auto &step = steps[step_index];
|
||||||
if (step.maneuver.instruction.type == TurnType::UseLane &&
|
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);
|
const auto previous = getPreviousIndex(step_index);
|
||||||
steps[previous] = elongate(steps[previous], steps[step_index]);
|
steps[previous] = elongate(steps[previous], steps[step_index]);
|
||||||
|
Loading…
Reference in New Issue
Block a user