Skip to content

Commit 15dc589

Browse files
oxidaseTheMarex
authored andcommitted
Use total angle for turn instruction if entry step has large distance
1 parent 7e932ff commit 15dc589

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

features/guidance/collapse.feature

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,3 +1019,39 @@ Feature: Collapse
10191019
| a,g | road,cross,cross | depart,fork left,arrive | a,b,g |
10201020
| a,e | road,road,road | depart,fork slight right,arrive | a,b,e |
10211021
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f |
1022+
1023+
1024+
# http://www.openstreetmap.org/way/92415447 #3933
1025+
Scenario: Use total angle for turn instruction if entry step has large distance
1026+
# """
1027+
# kf-_ a
1028+
# | - b
1029+
# | c
1030+
# |d
1031+
# e
1032+
# |
1033+
# i
1034+
# """
1035+
1036+
And the node locations
1037+
| node | lat | lon | #id |
1038+
| a | -33.9644254 | 151.1378673 | 33226063 |
1039+
| b | -33.9644373 | 151.1377172 | 1072787030 |
1040+
| c | -33.9644791 | 151.1374452 | 4222903609 |
1041+
| d | -33.9645661 | 151.1372654 | 4222903610 |
1042+
| e | -33.9646986 | 151.1371539 | 4222903611 |
1043+
| f | -33.964386 | 151.1372133 | 1072786875 |
1044+
| i | -33.9661796 | 151.1368491 | 2781176918 |
1045+
| k | -33.9643781 | 151.1371422 | 1684173853 |
1046+
1047+
And the ways
1048+
| nodes | highway | name | oneway | #id |
1049+
| ab | trunk | President Avenue | yes | 92415447 |
1050+
| bcde | trunk | President Avenue | yes | 422534457 |
1051+
| bf | trunk | President Avenue | yes | 447779786 |
1052+
| fk | trunk | President Avenue | yes | 179293012 |
1053+
| fei | trunk | Princes Highway | yes | 130099670 |
1054+
1055+
When I route I should get
1056+
| waypoints | route | turns | locations |
1057+
| a,i | President Avenue,Princes Highway,Princes Highway | depart,turn left,arrive | a,b,i |

src/engine/guidance/collapse_turns.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ double findTotalTurnAngle(const RouteStep &entry_step, const RouteStep &exit_ste
7474
if (entry_step.distance < MAX_COLLAPSE_DISTANCE)
7575
return true;
7676

77-
if (entry_step.distance > 2 * MAX_COLLAPSE_DISTANCE)
78-
return false;
79-
8077
// both go roughly in the same direction
8178
if ((entry_angle <= 185 && exit_angle <= 185) || (entry_angle >= 175 && exit_angle >= 175))
8279
return true;

0 commit comments

Comments
 (0)