]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/update/interpolation.feature
prepare release 5.3.2-post1
[nominatim.git] / test / bdd / features / db / update / interpolation.feature
1 Feature: Update of address interpolations
2     Test the interpolated address are updated correctly
3
4     Scenario: new interpolation added to existing street
5       Given the grid
6           | 10 |   |    |   | 11 |
7           |    | 1 | 99 | 2 |    |
8           |    |   |    |   |    |
9           | 20 |   |    |   | 21 |
10       And the places
11           | osm | class   | type         | name         | geometry |
12           | W2  | highway | unclassified | Sun Way      | 10,11    |
13           | W3  | highway | unclassified | Cloud Street | 20,21    |
14       When importing
15       Then W10 expands to no interpolation
16       When updating places
17           | osm | class | type  | housenr |
18           | N1  | place | house | 2       |
19           | N2  | place | house | 6       |
20       And updating interpolations
21           | osm | type | geometry | nodes |
22           | W10 | even | 1,2      | 1,2   |
23       Then placex contains
24           | object | parent_place_id |
25           | N1     | W2 |
26           | N2     | W2 |
27       And W10 expands to interpolation
28           | parent_place_id | start | end | geometry |
29           | W2              | 4     | 4   | 99       |
30
31     Scenario: addr:street added to interpolation
32       Given the grid
33           | 10 |   |    |   | 11 |
34           |    | 1 |    | 2 |    |
35           |    |   |    |   |    |
36           | 20 |   |    |   | 21 |
37       And the places
38           | osm | class | type  | housenr |
39           | N1  | place | house | 2       |
40           | N2  | place | house | 6       |
41       And the interpolations
42           | osm | type | geometry | nodes |
43           | W10 | even | 1,2      | 1,2   |
44       And the places
45           | osm | class   | type         | name         | geometry |
46           | W2  | highway | unclassified | Sun Way      | 10,11    |
47           | W3  | highway | unclassified | Cloud Street | 20,21    |
48       When importing
49       Then placex contains
50           | object | parent_place_id |
51           | N1     | W2 |
52           | N2     | W2 |
53       And W10 expands to interpolation
54           | parent_place_id | start | end |
55           | W2              | 4     | 4   |
56       When updating interpolations
57           | osm | type | street       | nodes | geometry |
58           | W10 | even | Cloud Street | 1,2   | 1,2      |
59       Then placex contains
60           | object | parent_place_id |
61           | N1     | W3 |
62           | N2     | W3 |
63       And W10 expands to interpolation
64           | parent_place_id | start | end |
65           | W3              | 4     | 4   |
66
67     Scenario: addr:street added to housenumbers
68       Given the grid
69           | 10 |   |    |   | 11 |
70           |    | 1 |    | 2 |    |
71           |    |   |    |   |    |
72           | 20 |   |    |   | 21 |
73       And the places
74           | osm | class | type  | housenr |
75           | N1  | place | house | 2       |
76           | N2  | place | house | 6       |
77       And the interpolations
78           | osm | type | geometry | nodes |
79           | W10 | even | 1,2      | 1,2   |
80       And the places
81           | osm | class   | type         | name         | geometry |
82           | W2  | highway | unclassified | Sun Way      | 10,11    |
83           | W3  | highway | unclassified | Cloud Street | 20,21    |
84       When importing
85       Then placex contains
86           | object | parent_place_id |
87           | N1     | W2 |
88           | N2     | W2 |
89       And W10 expands to interpolation
90           | parent_place_id | start | end |
91           | W2              | 4     | 4 |
92       When updating places
93           | osm | class | type  | street      | housenr |
94           | N1  | place | house | Cloud Street| 2       |
95           | N2  | place | house | Cloud Street| 6       |
96       Then placex contains
97           | object | parent_place_id |
98           | N1     | W3 |
99           | N2     | W3 |
100       And W10 expands to interpolation
101           | parent_place_id | start | end |
102           | W3              | 4     | 4   |
103
104     Scenario: interpolation tag removed
105       Given the grid
106           | 10 |   |    |   | 11 |
107           |    | 1 |    | 2 |    |
108           |    |   |    |   |    |
109           | 20 |   |    |   | 21 |
110       And the places
111           | osm | class | type  | housenr |
112           | N1  | place | house | 2       |
113           | N2  | place | house | 6       |
114       And the interpolations
115           | osm | type | geometry | nodes |
116           | W10 | even | 1,2      | 1,2   |
117       And the places
118           | osm | class   | type         | name         | geometry |
119           | W2  | highway | unclassified | Sun Way      | 10,11    |
120           | W3  | highway | unclassified | Cloud Street | 20,21    |
121       When importing
122       Then placex contains
123           | object | parent_place_id |
124           | N1     | W2 |
125           | N2     | W2 |
126       And W10 expands to interpolation
127           | parent_place_id | start | end |
128           | W2              | 4     | 4   |
129       When marking for delete W10
130       Then W10 expands to no interpolation
131       And placex contains
132           | object | parent_place_id |
133           | N1     | W2 |
134           | N2     | W2 |
135
136     Scenario: referenced road added
137       Given the grid
138           | 10 |   |    |   | 11 |
139           |    | 1 |    | 2 |    |
140           |    |   |    |   |    |
141           | 20 |   |    |   | 21 |
142       And the places
143           | osm | class | type  | housenr |
144           | N1  | place | house | 2       |
145           | N2  | place | house | 6       |
146       And the interpolations
147           | osm | type | street      | geometry | nodes |
148           | W10 | even | Cloud Street| 1,2      | 1,2   |
149       And the places
150           | osm | class   | type         | name     | geometry |
151           | W2  | highway | unclassified | Sun Way  | 10,11    |
152       When importing
153       Then placex contains
154           | object | parent_place_id |
155           | N1     | W2 |
156           | N2     | W2 |
157       And W10 expands to interpolation
158           | parent_place_id | start | end |
159           | W2              | 4     | 4 |
160       When updating places
161           | osm | class   | type         | name         | geometry |
162           | W3  | highway | unclassified | Cloud Street | 20,21    |
163       Then placex contains
164           | object | parent_place_id |
165           | N1     | W3 |
166           | N2     | W3 |
167       And W10 expands to interpolation
168           | parent_place_id | start | end |
169           | W3              | 4     | 4   |
170
171     Scenario: referenced road deleted
172       Given the grid
173           | 10 |   |    |   | 11 |
174           |    | 1 |    | 2 |    |
175           |    |   |    |   |    |
176           | 20 |   |    |   | 21 |
177       And the places
178           | osm | class | type  | housenr |
179           | N1  | place | house | 2       |
180           | N2  | place | house | 6       |
181       And the interpolations
182           | osm | type | street      | geometry | nodes |
183           | W10 | even | Cloud Street| 1,2      | 1,2   |
184       And the places
185           | osm | class   | type         | name         | geometry |
186           | W2  | highway | unclassified | Sun Way      | 10,11    |
187           | W3  | highway | unclassified | Cloud Street | 20,21    |
188       When importing
189       Then placex contains
190           | object | parent_place_id |
191           | N1     | W3 |
192           | N2     | W3 |
193       And W10 expands to interpolation
194           | parent_place_id | start | end |
195           | W3              | 4     | 4   |
196       When marking for delete W3
197       Then placex contains
198           | object | parent_place_id |
199           | N1     | W2 |
200           | N2     | W2 |
201       And W10 expands to interpolation
202           | parent_place_id | start | end |
203           | W2              | 4     | 4   |
204
205     Scenario: housenumbers added to interpolation
206       Given the grid
207           | 10 |   |    |   | 11 |
208           |    | 1 |    | 2 |    |
209       And the places
210           | osm | class   | type         | name         | geometry |
211           | W2  | highway | unclassified | Cloud Street | 10,11    |
212       And the interpolations
213           | osm | type | geometry | nodes |
214           | W1  | even | 1,2      | 1,2   |
215       When importing
216       Then W1 expands to no interpolation
217       When updating places
218           | osm | class | type  | housenr |
219           | N1  | place | house | 2       |
220           | N2  | place | house | 6       |
221       And updating interpolations
222           | osm | type | geometry | nodes |
223           | W1  | even | 1,2      | 1,2   |
224       Then W1 expands to interpolation
225           | parent_place_id | start | end |
226           | W2              | 4     | 4   |
227
228     Scenario: housenumber added in middle of interpolation
229       Given the grid
230           | 1 |  |  |   |  | 2 |
231           | 3 |  |  | 4 |  | 5 |
232       And the places
233           | osm | class   | type         | name         | geometry |
234           | W1  | highway | unclassified | Cloud Street | 1, 2     |
235       And the interpolations
236           | osm | type | geometry | nodes |
237           | W2  | even | 3,4,5    | 3,4,5 |
238       And the places
239           | osm | class | type  | housenr |
240           | N3  | place | house | 2       |
241           | N5  | place | house | 10      |
242       When importing
243       Then W2 expands to interpolation
244           | parent_place_id | start | end |
245           | W1              | 4     | 8  |
246       When updating places
247           | osm | class | type  | housenr |
248           | N4  | place | house | 6       |
249       And updating interpolations
250           | osm | type | geometry | nodes |
251           | W2  | even | 3,4,5    | 3,4,5 |
252       Then W2 expands to interpolation
253           | parent_place_id | start | end |
254           | W1              | 4     | 4   |
255           | W1              | 8     | 8   |
256
257     Scenario: housenumber removed in middle of interpolation
258       Given the grid
259           | 1 |  |  |   |  | 2 |
260           | 3 |  |  | 4 |  | 5 |
261       And the places
262           | osm | class   | type         | name         | geometry |
263           | W1  | highway | unclassified | Cloud Street | 1, 2     |
264       And the interpolations
265           | osm | type | geometry | nodes |
266           | W2  | even | 3,4,5    | 3,4,5 |
267       And the places
268           | osm | class | type  | housenr |
269           | N3  | place | house | 2       |
270           | N4  | place | house | 6       |
271           | N5  | place | house | 10      |
272       When importing
273       Then W2 expands to interpolation
274           | parent_place_id | start | end |
275           | W1              | 4     | 4   |
276           | W1              | 8     | 8   |
277       When marking for delete N4
278       And updating interpolations
279           | osm | type | geometry | nodes |
280           | W2  | even | 3,4,5    | 3,4,5 |
281       Then W2 expands to interpolation
282           | parent_place_id | start | end |
283           | W1              | 4     | 8   |
284
285     Scenario: Change the start housenumber
286       Given the grid
287           | 1 |  | 2 |
288           | 3 |  | 4 |
289       And the places
290           | osm | class   | type         | name         | geometry |
291           | W1  | highway | unclassified | Cloud Street | 1, 2     |
292       And the interpolations
293           | osm | type | geometry | nodes |
294           | W2  | even | 3,4      | 3,4   |
295       And the places
296           | osm | class | type  | housenr |
297           | N3  | place | house | 2       |
298           | N4  | place | house | 6       |
299       When importing
300       Then W2 expands to interpolation
301           | parent_place_id | start | end |
302           | W1              | 4     | 4   |
303       When updating places
304           | osm | class | type  | housenr |
305           | N4  | place | house | 8       |
306       And updating interpolations
307           | osm | type | geometry | nodes |
308           | W2  | even | 3,4      | 3,4   |
309       Then W2 expands to interpolation
310           | parent_place_id | start | end |
311           | W1              | 4     | 6   |