forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnap.feature
182 lines (153 loc) · 4.42 KB
/
snap.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
179
180
181
182
@routing @snap @testbot
Feature: Snap start/end point to the nearest way
Background:
Given the profile "testbot"
Scenario: Snap to nearest protruding oneway
Given the node map
"""
1 2
8 n 3
w c e
7 s 4
6 5
"""
And the ways
| nodes |
| nc |
| ec |
| sc |
| wc |
When I route I should get
| from | to | route |
| 1 | c | nc,nc |
| 2 | c | nc,nc |
| 3 | c | ec,ec |
| 4 | c | ec,ec |
| 5 | c | sc,sc |
| 6 | c | sc,sc |
| 7 | c | wc,wc |
| 8 | c | wc,wc |
Scenario: Snap to nearest edge of a square
Given the node map
"""
4 5 6 7
3 a u
2
1 d b
"""
And the ways
| nodes |
| aub |
| adb |
When I route I should get
| from | to | route |
| 1 | b | adb,adb |
| 2 | b | adb,adb |
| 6 | b | aub,aub |
| 7 | b | aub,aub |
Scenario: Snap to edge right under start/end point
Given the node map
"""
d e f g
c h
b i
a l k j
"""
And the ways
| nodes |
| abcd |
| defg |
| ghij |
| jkla |
When I route I should get
| from | to | route |
| a | b | abcd,abcd |
| a | c | abcd,abcd |
| a | d | abcd,abcd |
| a | e | abcd,defg,defg |
| a | f | abcd,defg,defg |
| a | h | jkla,ghij,ghij |
| a | i | jkla,ghij,ghij |
| a | j | jkla,jkla |
| a | k | jkla,jkla |
| a | l | jkla,jkla |
Scenario: Snapping in viaroute
Given the extract extra arguments "--small-component-size 4"
Given the node map
"""
a c e
b d f
"""
And the ways
| nodes |
| ab |
| cd |
| df |
| fe |
| ec |
When I route I should get
| from | to | route |
| a | b | ab,ab |
| a | d | cd,cd |
| c | d | cd,cd |
Scenario: Snap to correct way at large scales
Given a grid size of 1000 meters
Given the node map
"""
a
x b
c
"""
And the ways
| nodes |
| xa |
| xb |
| xc |
When I route I should get
| from | to | route |
| x | a | xa,xa |
| x | b | xb,xb |
| x | c | xc,xc |
| a | x | xa,xa |
| b | x | xb,xb |
| c | x | xc,xc |
Scenario: Find edges within 100m, and the same from 1km
Given a grid size of 100 meters
Given the node map
"""
p i j
8 1 2
h a b
o 7 g x c 3 k
f e d
6 5 4
n m l
"""
Given the ways
| nodes |
| xa |
| xb |
| xc |
| xd |
| xe |
| xf |
| xg |
| xh |
When I route I should get
| from | to | route |
| x | 1 | xa,xa |
| x | 2 | xb,xb |
| x | 3 | xc,xc |
| x | 4 | xd,xd |
| x | 5 | xe,xe |
| x | 6 | xf,xf |
| x | 7 | xg,xg |
| x | 8 | xh,xh |
| x | i | xa,xa |
| x | j | xb,xb |
| x | k | xc,xc |
| x | l | xd,xd |
| x | m | xe,xe |
| x | n | xf,xf |
| x | o | xg,xg |
| x | p | xh,xh |