fix emitting invalid turn types, now surfacing due to changes in obvious detection
Conflicts: features/guidance/dedicated-turn-roads.feature include/extractor/guidance/intersection.hpp
This commit is contained in:
parent
5159d57201
commit
bfbdd18834
@ -782,3 +782,40 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
|
||||
|
||||
Scenario: Sliproad before a roundabout
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a - b - - c - d
|
||||
'f|l'
|
||||
m
|
||||
g
|
||||
|
|
||||
.h-_
|
||||
k - i |
|
||||
'.j.'
|
||||
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway | highway | name |
|
||||
| ab | | yes | primary | road |
|
||||
| bc | | yes | primary | road |
|
||||
| cd | | yes | primary | road |
|
||||
| ec | | yes | secondary | |
|
||||
| cm | | yes | secondary | |
|
||||
| mg | | yes | primary | |
|
||||
| gh | | no | primary | |
|
||||
| hijh | roundabout | yes | primary | |
|
||||
| ik | | yes | primary | |
|
||||
| bfm | | yes | primary | |
|
||||
| gld | | yes | primary | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bc | cd | c | only_straight |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,k | road,,, | depart,continue right,roundabout turn right exit-1,arrive | a,b,h,k |
|
||||
|
@ -34,6 +34,14 @@ struct IntersectionShapeData
|
||||
};
|
||||
|
||||
inline auto makeCompareShapeDataByBearing(const double base_bearing)
|
||||
{
|
||||
return [base_bearing](const auto &lhs, const auto &rhs) {
|
||||
return util::angularDeviation(base_bearing, lhs.bearing) <
|
||||
util::angularDeviation(base_bearing, rhs.bearing);
|
||||
};
|
||||
}
|
||||
|
||||
inline auto makeCompareShapeDataAngleToBearing(const double base_bearing)
|
||||
{
|
||||
return [base_bearing](const auto &lhs, const auto &rhs) {
|
||||
return util::angleBetweenBearings(base_bearing, lhs.bearing) <
|
||||
|
@ -1073,7 +1073,8 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
|
||||
if (one_back_step.maneuver.instruction.type == TurnType::Sliproad)
|
||||
{
|
||||
if (current_step.maneuver.instruction.type == TurnType::Suppressed &&
|
||||
compatible(one_back_step, current_step))
|
||||
compatible(one_back_step, current_step) && current_step.intersections.size() == 1 &&
|
||||
current_step.intersections.front().entry.size() == 2)
|
||||
{
|
||||
// Traffic light on the sliproad, the road itself will be handled in the next
|
||||
// iteration, when one-back-index again points to the sliproad.
|
||||
|
@ -135,8 +135,9 @@ IntersectionGenerator::ComputeIntersectionShape(const NodeID node_at_center_of_i
|
||||
}
|
||||
return util::reverseBearing(intersection.begin()->bearing);
|
||||
}();
|
||||
std::sort(
|
||||
intersection.begin(), intersection.end(), makeCompareShapeDataByBearing(base_bearing));
|
||||
std::sort(intersection.begin(),
|
||||
intersection.end(),
|
||||
makeCompareShapeDataAngleToBearing(base_bearing));
|
||||
}
|
||||
return intersection;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user