forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollapse-detail.feature
178 lines (156 loc) · 6.56 KB
/
collapse-detail.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
@routing @guidance @collapsing
Feature: Collapse
Background:
Given the profile "car"
Given a grid size of 5 meters
@reverse
Scenario: Collapse U-Turn Triangle Intersection
Given the node map
"""
g---f---e---d
\ /
\ /
a-----b-----c
"""
And the ways
| nodes | highway | name | oneway |
| abc | primary | road | yes |
| defg | primary | road | yes |
| fb | primary_link | | yes |
| be | primary_link | | yes |
When I route I should get
| waypoints | route | turns | locations |
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g |
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c |
@reverse @traffic-signals
Scenario: Collapse U-Turn Triangle Intersection
Given the node map
"""
g---f---j---e---d
\ /
h i
\ /
a-------b-------c
"""
And the ways
| nodes | highway | name | oneway |
| abc | primary | road | yes |
| dejfg | primary | road | yes |
| fhb | primary_link | | yes |
| bie | primary_link | | yes |
And the nodes
| node | highway |
| j | traffic_signals |
| h | traffic_signals |
| i | traffic_signals |
When I route I should get
| waypoints | route | turns | locations |
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g |
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c |
Scenario: Forking before a turn (forky)
Given the node map
"""
g
.
c
a . . b .'
`d.
f e
"""
# note: check collapse.feature for a similar test case where we do not
# classify the situation as Sliproad and therefore keep the fork inst.
And the ways
| nodes | name | oneway | highway |
| ab | road | yes | primary |
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns | locations |
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f |
Scenario: Forking before a turn (forky), larger
Given the node map
"""
g
.
c
.'|
.' |
a . . b .' |
' . |
` d
f ' e
"""
And the ways
| nodes | name | oneway | highway |
| ab | road | yes | primary |
| bd | road | yes | primary |
| bc | road | yes | primary |
| de | road | yes | primary |
| fd | cross | no | secondary |
| dc | cross | no | secondary |
| cg | cross | no | secondary |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_left_turn |
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns | locations |
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f |
Scenario: Pulled Back Turn
Given the node map
"""
d
|
a-b-c
|
e
"""
And the ways
| nodes | highway | name |
| abc | tertiary | road |
| cd | tertiary | left |
| be | tertiary | right |
When I route I should get
| waypoints | route | turns |
| a,d | road,left,left | depart,turn left,arrive |
| a,e | road,right,right | depart,turn right,arrive |
# https://www.openstreetmap.org/#map=18/53.89755/27.54306
Scenario: Wide turn into invalid u-turn
Given the node map
"""
g
|
|
f - - - - e
|
|
|
h - - d
|
|
|
a - - - - b - - - - c
"""
And the ways
| nodes | highway | name |
| abc | secondary | road |
| bdfg | service | |
| hd | service | |
| fe | service | |
When I route I should get
| waypoints | route | turns |
| c,e | road,,, | depart,turn right,turn right,arrive |