From 1d26deb0bee99ce2cf2e9c4ec9ce7e787399e8ca Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Mon, 22 May 2017 17:16:48 +0200 Subject: [PATCH] Allow counting of service exits on service roundabouts, see #4075 --- CHANGELOG.md | 3 +++ features/guidance/roundabout.feature | 21 ++++++++----------- src/extractor/guidance/roundabout_handler.cpp | 9 ++++++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88b0c8544f..a9570324fff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Added conditional restriction support with `parse-conditional-restrictions=true|false` to osrm-extract. This option saves conditional turn restrictions to the .restrictions file for parsing by contract later. Added `parse-conditionals-from-now=utc time stamp` and `--time-zone-file=/path/to/file` to osrm-contract - Files - .osrm.nodes file was renamed to .nbg_nodes and .ebg_nodes was added + - Guidance + - #4075 Changed counting of exits on service roundabouts + # 5.7.1 - Bugfixes diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature index 60dbe5fcade..58ea4ddf4e1 100644 --- a/features/guidance/roundabout.feature +++ b/features/guidance/roundabout.feature @@ -796,26 +796,23 @@ Feature: Basic Roundabout @4030 @4075 Scenario: Service roundabout with service exits - # Counting of service exits must be adjusted in #4075 Given the node map """ - e - f a d - g b1c - h + g a d f + h b1c e """ And the ways | nodes | highway | junction | | abcda | service | roundabout | - | de | service | | - | af | service | | - | bg | tertiary | | + | ce | service | | + | df | service | | + | ag | tertiary | | | bh | service | | When I route I should get | from | to | route | turns | - | 1 | e | abcda,de,de | depart,roundabout-exit-1,arrive | - | 1 | f | abcda,af,af | depart,roundabout-exit-1,arrive | - | 1 | g | abcda,bg,bg | depart,roundabout-exit-1,arrive | - | 1 | h | abcda,bh,bh | depart,roundabout-exit-1,arrive | + | 1 | e | abcda,ce,ce | depart,roundabout-exit-1,arrive | + | 1 | f | abcda,df,df | depart,roundabout-exit-2,arrive | + | 1 | g | abcda,ag,ag | depart,roundabout-exit-3,arrive | + | 1 | h | abcda,bh,bh | depart,roundabout-exit-4,arrive | diff --git a/src/extractor/guidance/roundabout_handler.cpp b/src/extractor/guidance/roundabout_handler.cpp index d1deba7cb19..221802341d4 100644 --- a/src/extractor/guidance/roundabout_handler.cpp +++ b/src/extractor/guidance/roundabout_handler.cpp @@ -478,13 +478,18 @@ Intersection RoundaboutHandler::handleRoundabouts(const RoundaboutType roundabou return true; } return false; - }(); + }; - if (has_non_ignorable_exit) + if (out_data.road_classification.IsLowPriorityRoadClass() || + has_non_ignorable_exit()) + { turn.instruction = TurnInstruction::REMAIN_ROUNDABOUT( roundabout_type, getTurnDirection(turn.angle)); + } else + { // Suppress exit instructions from normal roundabouts to service roads turn.instruction = {TurnType::Suppressed, getTurnDirection(turn.angle)}; + } } } else