Skip to content

Commit 875f482

Browse files
daniel-j-hPatrick Niklaus
authored andcommitted
Refactors and improves the Sliproad Handler, resolves #3109
1 parent df3c39c commit 875f482

16 files changed

+1782
-744
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Improved turn angle calculation, detecting offsets due to lanes / minor variations due to inaccuracies
2020
- Corrected the bearings returned for intermediate steps - requires reprocessing
2121
- Improved turn locations for collapsed turns
22+
- Sliproad classification refinements: the situations we detect as Sliproads now resemble more closely the reality
2223
- Trip Plugin
2324
- changed internal behaviour to prefer the smallest lexicographic result over the largest one
2425
- Bugfixes

features/car/names.feature

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,24 @@ Feature: Car - Street names in instructions
7878
Scenario: Inner city expressway with on road
7979
Given the node map
8080
"""
81-
a b c g
82-
f
83-
84-
85-
81+
a b . . . c g
82+
`f .
83+
`
84+
.
85+
.
8686
d
87-
88-
89-
87+
.
88+
.
89+
.
9090
e
9191
"""
9292

9393
And the ways
94-
| nodes | highway | name | name:pronunciation |
95-
| abc | primary | road | roooaad |
96-
| cg | primary | road | roooaad |
97-
| bfd | trunk_link | | |
98-
| cde | trunk | trunk | truank |
94+
| nodes | highway | name | name:pronunciation | oneway |
95+
| abc | primary | road | roooaad | |
96+
| cg | primary | road | roooaad | |
97+
| bfd | trunk_link | sliproad | | yes |
98+
| cde | trunk | trunk | truank | yes |
9999

100100
And the relations
101101
| type | way:from | way:to | node:via | restriction |

features/guidance/advanced-lanes.feature

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ Feature: Turn Lane Guidance
55
Given the profile "car"
66
Given a grid size of 3 meters
77

8+
89
@sliproads
910
Scenario: Separate Turn Lanes
1011
Given the node map
1112
"""
1213
e
13-
a b c g
14-
d
14+
.
15+
a ... b ..... c . g
16+
` .
17+
`... d
18+
.
1519
f
1620
"""
1721

@@ -41,8 +45,10 @@ Feature: Turn Lane Guidance
4145
Given the node map
4246
"""
4347
e
44-
a b c g
45-
d
48+
a . . b . . . c g
49+
` .
50+
` .
51+
` d
4652
f
4753
"""
4854

@@ -67,21 +73,22 @@ Feature: Turn Lane Guidance
6773
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
6874
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
6975

76+
7077
@sliproads
7178
Scenario: Separate Turn Lanes Next to other turns
7279
Given the node map
7380
"""
74-
e
75-
a - - b.-.- - c-g
76-
| ' 'd
77-
| f
78-
|
79-
|
80-
|
81-
|
82-
|
83-
|
84-
i - - h - - - j
81+
. e
82+
a . . b . . . c g
83+
. ` .
84+
. ` .
85+
. d
86+
. f
87+
.
88+
.
89+
.
90+
.
91+
i . . h . . . j
8592
"""
8693

8794
And the ways
@@ -109,6 +116,7 @@ Feature: Turn Lane Guidance
109116
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
110117
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
111118

119+
112120
@todo @2654 @none
113121
#https://github.com/Project-OSRM/osrm-backend/issues/2645
114122
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
@@ -231,6 +239,7 @@ Feature: Turn Lane Guidance
231239
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
232240
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
233241

242+
234243
Scenario: Check sliproad handler loop's exit condition, Issue #2896
235244
# http://www.openstreetmap.org/way/198481519
236245
Given the node locations

features/guidance/collapse-detail.feature

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,38 @@ Feature: Collapse
5555
| waypoints | route | turns |
5656
| a,g | road,road,road | depart,continue uturn,arrive |
5757
| d,c | road,road,road | depart,continue uturn,arrive |
58+
59+
Scenario: Forking before a turn (forky)
60+
Given the node map
61+
"""
62+
g
63+
.
64+
c
65+
a . . b .'
66+
`d.
67+
f e
68+
"""
69+
# note: check clooapse.feature for a similar test case where we do not
70+
# classify the situation as Sliproad and therefore keep the fork inst.
71+
72+
And the ways
73+
| nodes | name | oneway | highway |
74+
| ab | road | yes | primary |
75+
| bd | road | yes | primary |
76+
| bc | road | yes | primary |
77+
| de | road | yes | primary |
78+
| fd | cross | no | secondary |
79+
| dc | cross | no | secondary |
80+
| cg | cross | no | secondary |
81+
82+
And the relations
83+
| type | way:from | way:to | node:via | restriction |
84+
| restriction | bd | dc | d | no_left_turn |
85+
| restriction | bc | dc | c | no_right_turn |
86+
87+
When I route I should get
88+
| waypoints | route | turns |
89+
| a,g | road,cross,cross | depart,turn left,arrive |
90+
| a,e | road,road,road | depart,continue right,arrive |
91+
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
92+
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |

features/guidance/collapse.feature

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -701,12 +701,15 @@ Feature: Collapse
701701
Given the node map
702702
"""
703703
g
704-
704+
.
705705
c
706-
a b
707-
d
706+
a . . b .'
707+
` d.
708708
f e
709709
"""
710+
# as it is right now we don't classify this as a sliproad,
711+
# check collapse-detail.feature for a similar test case
712+
# which removes the fork here due to it being a Sliproad.
710713

711714
And the ways
712715
| nodes | name | oneway | highway |
@@ -725,10 +728,9 @@ Feature: Collapse
725728

726729
When I route I should get
727730
| waypoints | route | turns |
728-
| a,g | road,cross,cross | depart,turn left,arrive |
729-
| a,e | road,road,road | depart,continue straight,arrive |
730-
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
731-
| a,f | road,road,cross,cross | depart,continue straight,turn right,arrive |
731+
| a,g | road,cross,cross | depart,fork left,arrive |
732+
| a,e | road,road,road | depart,fork slight right,arrive |
733+
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive |
732734

733735
Scenario: On-Off on Highway
734736
Given the node map

0 commit comments

Comments
 (0)