From 6cf99c886fcb42c4e417f5477ed2c9d2eebb5554 Mon Sep 17 00:00:00 2001 From: Moritz Kobitzsch Date: Tue, 11 Oct 2016 10:32:55 +0200 Subject: [PATCH] don't emit invalid on sliproads with incompatible modes --- CHANGELOG.md | 5 ++++ features/guidance/bicycle-sliproads.feature | 33 +++++++++++++++++++++ src/engine/guidance/post_processing.cpp | 7 ++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 features/guidance/bicycle-sliproads.feature diff --git a/CHANGELOG.md b/CHANGELOG.md index ef9ed1cd5..5df2c71da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ - Debug Tiles - Added support for turn penalties +# 5.4.2 + - Changes from 5.4.1 + - Bugfixes + - #3032 Fixed a bug that could result in emitting `invalid` as an instruction type on sliproads with mode changes + # 5.4.1 - Changes from 5.4.0 - Bugfixes diff --git a/features/guidance/bicycle-sliproads.feature b/features/guidance/bicycle-sliproads.feature new file mode 100644 index 000000000..15d5a40cc --- /dev/null +++ b/features/guidance/bicycle-sliproads.feature @@ -0,0 +1,33 @@ +@routing @bicycle @mode +Feature: Bike - Mode flag + + Background: + Given the profile "bicycle" + Given a grid size of 5 meters + + Scenario: Bike Sliproad + Given the node map + """ + i + a b - c-d + ` | + g-e-h + | + | + f + """ + + And the nodes + | node | highway | + | c | traffic_signals | + + And the ways + | nodes | highway | name | oneway:bicycle | + | abcd | cycleway | street | | + | eb | path | | yes | + | icef | tertiary | road | | + | geh | secondary | street | | + + When I route I should get + | waypoints | route | turns | + | a,f | street,{highway:path},road,road | depart,turn right,turn right,arrive | diff --git a/src/engine/guidance/post_processing.cpp b/src/engine/guidance/post_processing.cpp index 7f02b664c..e57d0fe98 100644 --- a/src/engine/guidance/post_processing.cpp +++ b/src/engine/guidance/post_processing.cpp @@ -1,5 +1,5 @@ -#include "engine/guidance/post_processing.hpp" #include "extractor/guidance/turn_instruction.hpp" +#include "engine/guidance/post_processing.hpp" #include "engine/guidance/assemble_steps.hpp" #include "engine/guidance/lane_processing.hpp" @@ -838,6 +838,11 @@ std::vector collapseTurns(std::vector steps) ::osrm::util::guidance::getTurnDirection(angle); invalidateStep(steps[step_index]); } + else + { + //the sliproad turn is incompatible. So we handle it as a turn + steps[one_back_index].maneuver.instruction.type = TurnType::Turn; + } } } // Due to empty segments, we can get name-changes from A->A