Skip to content

Commit

Permalink
Adjust lower bound for crossroad angle in sliproads handler, #4348/2
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Aug 3, 2017
1 parent fe9aae3 commit 2b62c45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions features/guidance/dedicated-turn-roads.feature
Original file line number Diff line number Diff line change
Expand Up @@ -994,5 +994,5 @@ Feature: Slipways and Dedicated Turn Lanes


When I route I should get
| waypoints | route | turns | locations |
| s,f | sabc,ae,dbef,dbef | depart,turn right,turn slight right,arrive | s,a,e,f |
| waypoints | route | turns | locations |
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
6 changes: 3 additions & 3 deletions src/extractor/guidance/sliproad_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
using namespace util::coordinate_calculation;

// In addition, if it's a right/left turn we expect the rightmost/leftmost
// turn at `c` to be more or less ~90 degree for a Sliproad scenario.
// turn at `c` to be more than a minimal angle (45°) for a Sliproad scenario.
double deviation_from_straight = 0;

if (is_right_sliproad_turn)
Expand Down Expand Up @@ -423,7 +423,7 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
const auto length = haversineDistance(coordinates[intersection_node_id],
coordinates[main_road_intersection->node]);

const double perpendicular_angle = 90 + FUZZY_ANGLE_DIFFERENCE;
const double minimal_crossroad_angle = 45.;

if (length >= MIN_LENGTH)
{
Expand All @@ -432,7 +432,7 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
continue;
}

if (deviation_from_straight > perpendicular_angle)
if (deviation_from_straight > 180. - minimal_crossroad_angle)
{
continue;
}
Expand Down

0 comments on commit 2b62c45

Please sign in to comment.