Skip to content

Commit 531b281

Browse files
committed
Use the correct driving_side property on the arrive step. (#4708)
Use the correct driving_side property on the arrive step.
1 parent 7137459 commit 531b281

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

features/car/side_bias.feature

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,28 @@ Feature: Testbot - side bias
116116
| from | to | route | driving_side | time |
117117
| d | a | bd,ab,ab | right,right,right | 27s +-1 |
118118
| d | c | bd,bc,bc | right,right,right | 24s +-1 |
119+
120+
Scenario: changing sides
121+
Given the profile "car"
122+
123+
# Note - the boundary in null-island.geojson is at lon = 2.0,
124+
# and we use the "last node of the way" as the heuristic to detect
125+
# whether the way is in our out of the driving_side polygon
126+
And the node locations
127+
| node | lat | lon |
128+
| a | 0 | 0.5 |
129+
| b | 0 | 1.5 |
130+
| c | 0 | 2.5 |
131+
| d | 0 | 3.5 |
132+
133+
And the ways
134+
| nodes |
135+
| ab |
136+
| bc |
137+
| cd |
138+
139+
And the extract extra arguments "--location-dependent-data test/data/regions/null-island.geojson"
140+
When I route I should get
141+
| from | to | route | driving_side |
142+
| d | a | cd,bc,ab,ab | right,right,left,left |
143+
| a | d | ab,bc,cd,cd | left,right,right,right |

include/engine/guidance/assemble_steps.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
312312
leg_geometry.locations.size() - 1,
313313
leg_geometry.locations.size(),
314314
{intersection},
315-
facade.IsLeftHandDriving(source_node_id)});
315+
facade.IsLeftHandDriving(target_node_id)});
316316

317317
BOOST_ASSERT(steps.front().intersections.size() == 1);
318318
BOOST_ASSERT(steps.front().intersections.front().bearings.size() == 1);

0 commit comments

Comments
 (0)