From c1efefae278a207081dbac6ea12ceec8ffeb9fb7 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Mon, 27 Nov 2017 13:16:33 -0800 Subject: [PATCH] Use the correct driving_side property on the arrive step. (#4708) Use the correct driving_side property on the arrive step. --- features/car/side_bias.feature | 25 ++++++++++++++++++++++ include/engine/guidance/assemble_steps.hpp | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/features/car/side_bias.feature b/features/car/side_bias.feature index 3ee283e4b..a44fa08a6 100644 --- a/features/car/side_bias.feature +++ b/features/car/side_bias.feature @@ -116,3 +116,28 @@ Feature: Testbot - side bias | from | to | route | driving_side | time | | d | a | bd,ab,ab | right,right,right | 27s +-1 | | d | c | bd,bc,bc | right,right,right | 24s +-1 | + + Scenario: changing sides + Given the profile "car" + + # Note - the boundary in null-island.geojson is at lon = 2.0, + # and we use the "last node of the way" as the heuristic to detect + # whether the way is in our out of the driving_side polygon + And the node locations + | node | lat | lon | + | a | 0 | 0.5 | + | b | 0 | 1.5 | + | c | 0 | 2.5 | + | d | 0 | 3.5 | + + And the ways + | nodes | + | ab | + | bc | + | cd | + + And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson" + When I route I should get + | from | to | route | driving_side | + | d | a | cd,bc,ab,ab | right,right,left,left | + | a | d | ab,bc,cd,cd | left,right,right,right | diff --git a/include/engine/guidance/assemble_steps.hpp b/include/engine/guidance/assemble_steps.hpp index 3a00a9c6f..f07d5f0df 100644 --- a/include/engine/guidance/assemble_steps.hpp +++ b/include/engine/guidance/assemble_steps.hpp @@ -312,7 +312,7 @@ inline std::vector assembleSteps(const datafacade::BaseDataFacade &fa leg_geometry.locations.size() - 1, leg_geometry.locations.size(), {intersection}, - facade.IsLeftHandDriving(source_node_id)}); + facade.IsLeftHandDriving(target_node_id)}); BOOST_ASSERT(steps.front().intersections.size() == 1); BOOST_ASSERT(steps.front().intersections.front().bearings.size() == 1);