only consider narrow turns onto through streets straight
This commit is contained in:
parent
2522f70f86
commit
4c7aa8f1c0
@ -1372,7 +1372,9 @@ Feature: Simple Turns
|
|||||||
| waypoints | route |
|
| waypoints | route |
|
||||||
| g,e | abcde,abcde |
|
| g,e | abcde,abcde |
|
||||||
|
|
||||||
Scenario: small ticks in roads
|
# 4205
|
||||||
|
# https://www.openstreetmap.org/node/36153635#map=19/51.97548/7.61795
|
||||||
|
Scenario: merging onto a through street
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
e
|
e
|
||||||
@ -1440,6 +1442,5 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,f | fww,jahn,jahn | depart,turn straight,arrive |
|
| a,f | fww,jahn,jahn | depart,turn right,arrive |
|
||||||
| a,e | fww,jahn,jahn | depart,turn left,arrive |
|
| a,e | fww,jahn,jahn | depart,turn left,arrive |
|
||||||
|
|
||||||
|
@ -119,7 +119,9 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t
|
|||||||
const double constexpr MAX_COLLAPSE_DISTANCE = 30;
|
const double constexpr MAX_COLLAPSE_DISTANCE = 30;
|
||||||
// in normal road condidtions, we check if the turn is nearly straight.
|
// in normal road condidtions, we check if the turn is nearly straight.
|
||||||
// Doing so, we widen the angle that a turn is considered straight, but since it
|
// Doing so, we widen the angle that a turn is considered straight, but since it
|
||||||
// is obvious, the choice is arguably better.
|
// is obvious, the choice is arguably better. We need the road to continue for a
|
||||||
|
// bit though, until we assume this is safe to do. In addition, the angle cannot
|
||||||
|
// get too wide, so we only allow narrow turn angles to begin with.
|
||||||
|
|
||||||
// FIXME this requires https://github.com/Project-OSRM/osrm-backend/pull/2399,
|
// FIXME this requires https://github.com/Project-OSRM/osrm-backend/pull/2399,
|
||||||
// since `distance` does not refer to an actual distance but rather to the
|
// since `distance` does not refer to an actual distance but rather to the
|
||||||
@ -129,9 +131,9 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t
|
|||||||
const auto distance = util::coordinate_calculation::haversineDistance(
|
const auto distance = util::coordinate_calculation::haversineDistance(
|
||||||
coordinates[node_based_graph.GetTarget(via_edge)],
|
coordinates[node_based_graph.GetTarget(via_edge)],
|
||||||
coordinates[node_based_graph.GetTarget(road.eid)]);
|
coordinates[node_based_graph.GetTarget(road.eid)]);
|
||||||
return {
|
|
||||||
TurnType::Turn,
|
return {TurnType::Turn,
|
||||||
(angularDeviation(road.angle, STRAIGHT_ANGLE) < FUZZY_ANGLE_DIFFERENCE ||
|
(angularDeviation(road.angle, STRAIGHT_ANGLE) < NARROW_TURN_ANGLE &&
|
||||||
distance > 2 * MAX_COLLAPSE_DISTANCE)
|
distance > 2 * MAX_COLLAPSE_DISTANCE)
|
||||||
? DirectionModifier::Straight
|
? DirectionModifier::Straight
|
||||||
: getTurnDirection(road.angle)};
|
: getTurnDirection(road.angle)};
|
||||||
|
Loading…
Reference in New Issue
Block a user