diff --git a/features/guidance/dedicated-turn-roads.feature b/features/guidance/dedicated-turn-roads.feature index 6cfaeb5dd..12669a5ff 100644 --- a/features/guidance/dedicated-turn-roads.feature +++ b/features/guidance/dedicated-turn-roads.feature @@ -1049,5 +1049,5 @@ Feature: Slipways and Dedicated Turn Lanes When I route I should get - | waypoints | route | turns | locations | - | s,f | sab,ae,dbcef,dbcef | depart,turn right,turn slight right,arrive | s,a,e,f | + | waypoints | route | turns | locations | + | s,f | sab,dbcef,dbcef | depart,turn right,arrive | s,a,f | diff --git a/src/extractor/guidance/sliproad_handler.cpp b/src/extractor/guidance/sliproad_handler.cpp index 6a0903620..e6cc2bd89 100644 --- a/src/extractor/guidance/sliproad_handler.cpp +++ b/src/extractor/guidance/sliproad_handler.cpp @@ -493,7 +493,21 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter continue; } - if (node_based_graph.GetTarget(candidate_road.eid) == main_road_intersection->node) + // Check that the cross-road `candidate_road_target` that starts at `d` ends at + // main intersection node `c` or has a common node `e` with a cross-road from `c` + // a ... b .... c a ... b .... c + // ` . ` . + // ` . ` e... + // ` . ` . + // d d + // + const auto candidate_road_target = node_based_graph.GetTarget(candidate_road.eid); + if ((candidate_road_target == main_road_intersection->node) || + (candidate_road_target == node_based_graph.GetTarget(crossing_road.eid) && + util::bearing::angleBetween(candidate_road.bearing, crossing_road.bearing) < + FUZZY_ANGLE_DIFFERENCE && + (getTurnDirection(candidate_road.angle) == DirectionModifier::SharpRight || + getTurnDirection(candidate_road.angle) == DirectionModifier::SharpLeft))) { sliproad.instruction.type = TurnType::Sliproad; sliproad_found = true;