]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/update/interpolation.feature
release 5.1.0.post5
[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       And the ways
15           | id  | nodes |
16           | 10  | 1,2   |
17       When importing
18       Then W10 expands to no interpolation
19       When updating places
20           | osm | class | type  | housenr |
21           | N1  | place | house | 2       |
22           | N2  | place | house | 6       |
23       And updating places
24           | osm | class | type   | addr+interpolation | geometry |
25           | W10 | place | houses | even               | 1,2      |
26       Then placex contains
27           | object | parent_place_id |
28           | N1     | W2 |
29           | N2     | W2 |
30       And W10 expands to interpolation
31           | parent_place_id | start | end | geometry |
32           | W2              | 4     | 4   | 99       |
33
34     Scenario: addr:street added to interpolation
35       Given the grid
36           | 10 |   |    |   | 11 |
37           |    | 1 |    | 2 |    |
38           |    |   |    |   |    |
39           | 20 |   |    |   | 21 |
40       And the places
41           | osm | class | type  | housenr |
42           | N1  | place | house | 2       |
43           | N2  | place | house | 6       |
44       And the places
45           | osm | class | type   | addr+interpolation | geometry |
46           | W10 | place | houses | even               | 1,2      |
47       And the places
48           | osm | class   | type         | name         | geometry |
49           | W2  | highway | unclassified | Sun Way      | 10,11    |
50           | W3  | highway | unclassified | Cloud Street | 20,21    |
51       And the ways
52           | id  | nodes |
53           | 10  | 1,2 |
54       When importing
55       Then placex contains
56           | object | parent_place_id |
57           | N1     | W2 |
58           | N2     | W2 |
59       And W10 expands to interpolation
60           | parent_place_id | start | end |
61           | W2              | 4     | 4   |
62       When updating places
63           | osm | class   | type    | addr+interpolation | street       | geometry |
64           | W10 | place   | houses  | even               | Cloud Street | 1,2      |
65       Then placex contains
66           | object | parent_place_id |
67           | N1     | W3 |
68           | N2     | W3 |
69       And W10 expands to interpolation
70           | parent_place_id | start | end |
71           | W3              | 4     | 4   |
72
73     Scenario: addr:street added to housenumbers
74       Given the grid
75           | 10 |   |    |   | 11 |
76           |    | 1 |    | 2 |    |
77           |    |   |    |   |    |
78           | 20 |   |    |   | 21 |
79       And the places
80           | osm | class | type  | housenr |
81           | N1  | place | house | 2       |
82           | N2  | place | house | 6       |
83       And the places
84           | osm | class | type   | addr+interpolation | geometry |
85           | W10 | place | houses | even               | 1,2      |
86       And the places
87           | osm | class   | type         | name         | geometry |
88           | W2  | highway | unclassified | Sun Way      | 10,11    |
89           | W3  | highway | unclassified | Cloud Street | 20,21    |
90       And the ways
91           | id  | nodes |
92           | 10  | 1,2 |
93       When importing
94       Then placex contains
95           | object | parent_place_id |
96           | N1     | W2 |
97           | N2     | W2 |
98       And W10 expands to interpolation
99           | parent_place_id | start | end |
100           | W2              | 4     | 4 |
101       When updating places
102           | osm | class | type  | street      | housenr |
103           | N1  | place | house | Cloud Street| 2       |
104           | N2  | place | house | Cloud Street| 6       |
105       Then placex contains
106           | object | parent_place_id |
107           | N1     | W3 |
108           | N2     | W3 |
109       And W10 expands to interpolation
110           | parent_place_id | start | end |
111           | W3              | 4     | 4   |
112
113     Scenario: interpolation tag removed
114       Given the grid
115           | 10 |   |    |   | 11 |
116           |    | 1 |    | 2 |    |
117           |    |   |    |   |    |
118           | 20 |   |    |   | 21 |
119       And the places
120           | osm | class | type  | housenr |
121           | N1  | place | house | 2       |
122           | N2  | place | house | 6       |
123       And the places
124           | osm | class | type   | addr+interpolation | geometry |
125           | W10 | place | houses | even               | 1,2      |
126       And the places
127           | osm | class   | type         | name         | geometry |
128           | W2  | highway | unclassified | Sun Way      | 10,11    |
129           | W3  | highway | unclassified | Cloud Street | 20,21    |
130       And the ways
131           | id  | nodes |
132           | 10  | 1,2 |
133       When importing
134       Then placex contains
135           | object | parent_place_id |
136           | N1     | W2 |
137           | N2     | W2 |
138       And W10 expands to interpolation
139           | parent_place_id | start | end |
140           | W2              | 4     | 4   |
141       When marking for delete W10
142       Then W10 expands to no interpolation
143       And placex contains
144           | object | parent_place_id |
145           | N1     | W2 |
146           | N2     | W2 |
147
148     Scenario: referenced road added
149       Given the grid
150           | 10 |   |    |   | 11 |
151           |    | 1 |    | 2 |    |
152           |    |   |    |   |    |
153           | 20 |   |    |   | 21 |
154       And the places
155           | osm | class | type  | housenr |
156           | N1  | place | house | 2       |
157           | N2  | place | house | 6       |
158       And the places
159           | osm | class   | type    | addr+interpolation | street      | geometry |
160           | W10 | place   | houses  | even               | Cloud Street| 1,2      |
161       And the places
162           | osm | class   | type         | name     | geometry |
163           | W2  | highway | unclassified | Sun Way  | 10,11    |
164       And the ways
165           | id  | nodes |
166           | 10  | 1,2   |
167       When importing
168       Then placex contains
169           | object | parent_place_id |
170           | N1     | W2 |
171           | N2     | W2 |
172       And W10 expands to interpolation
173           | parent_place_id | start | end |
174           | W2              | 4     | 4 |
175       When updating places
176           | osm | class   | type         | name         | geometry |
177           | W3  | highway | unclassified | Cloud Street | 20,21    |
178       Then placex contains
179           | object | parent_place_id |
180           | N1     | W3 |
181           | N2     | W3 |
182       And W10 expands to interpolation
183           | parent_place_id | start | end |
184           | W3              | 4     | 4   |
185
186     Scenario: referenced road deleted
187       Given the grid
188           | 10 |   |    |   | 11 |
189           |    | 1 |    | 2 |    |
190           |    |   |    |   |    |
191           | 20 |   |    |   | 21 |
192       And the places
193           | osm | class | type  | housenr |
194           | N1  | place | house | 2       |
195           | N2  | place | house | 6       |
196       And the places
197           | osm | class   | type    | addr+interpolation | street      | geometry |
198           | W10 | place   | houses  | even               | Cloud Street| 1,2      |
199       And the places
200           | osm | class   | type         | name         | geometry |
201           | W2  | highway | unclassified | Sun Way      | 10,11    |
202           | W3  | highway | unclassified | Cloud Street | 20,21    |
203       And the ways
204           | id  | nodes |
205           | 10  | 1,2 |
206       When importing
207       Then placex contains
208           | object | parent_place_id |
209           | N1     | W3 |
210           | N2     | W3 |
211       And W10 expands to interpolation
212           | parent_place_id | start | end |
213           | W3              | 4     | 4   |
214       When marking for delete W3
215       Then placex contains
216           | object | parent_place_id |
217           | N1     | W2 |
218           | N2     | W2 |
219       And W10 expands to interpolation
220           | parent_place_id | start | end |
221           | W2              | 4     | 4   |
222
223     Scenario: building becomes interpolation
224       Given the grid
225           | 10 |   |    |   | 11 |
226           |    | 1 |    | 2 |    |
227           |    | 4 |    | 3 |    |
228       And the places
229           | osm | class    | type  | housenr | geometry    |
230           | W1  | place    | house | 3       | (1,2,3,4,1) |
231       And the places
232           | osm | class   | type         | name         | geometry |
233           | W2  | highway | unclassified | Cloud Street | 10,11    |
234       When importing
235       Then placex contains
236           | object | parent_place_id |
237           | W1     | W2 |
238       Given the ways
239           | id  | nodes |
240           | 1   | 1,2   |
241       When updating places
242           | osm | class | type  | housenr |
243           | N1  | place | house | 2       |
244           | N2  | place | house | 6       |
245       And updating places
246           | osm | class   | type    | addr+interpolation | street      | geometry |
247           | W1  | place   | houses  | even               | Cloud Street| 1,2      |
248       Then placex has no entry for W1
249       And W1 expands to interpolation
250           | parent_place_id | start | end |
251           | W2              | 4     | 4   |
252
253     Scenario: interpolation becomes building
254       Given the grid
255           | 10 |   |    |   | 11 |
256           |    | 1 |    | 2 |    |
257           |    | 4 |    | 3 |    |
258       And the places
259           | osm | class | type  | housenr |
260           | N1  | place | house | 2       |
261           | N2  | place | house | 6       |
262       And the places
263           | osm | class   | type         | name         | geometry |
264           | W2  | highway | unclassified | Cloud Street | 10,11    |
265       And the ways
266           | id  | nodes |
267           | 1   | 1,2 |
268       And the places
269           | osm | class   | type    | addr+interpolation | street      | geometry |
270           | W1  | place   | houses  | even               | Cloud Street| 1,2      |
271       When importing
272       Then placex has no entry for W1
273       And W1 expands to interpolation
274           | parent_place_id | start | end |
275           | W2              | 4     | 4   |
276       When updating places
277           | osm | class    | type  | housenr | geometry    |
278           | W1  | place    | house | 3       | (1,2,3,4,1) |
279       Then placex contains
280           | object | parent_place_id |
281           | W1     | W2 |
282       And W1 expands to no interpolation
283
284     Scenario: housenumbers added to interpolation
285       Given the grid
286           | 10 |   |    |   | 11 |
287           |    | 1 |    | 2 |    |
288       And the places
289           | osm | class   | type         | name         | geometry |
290           | W2  | highway | unclassified | Cloud Street | 10,11    |
291       And the ways
292           | id  | nodes |
293           | 1   | 1,2 |
294       And the places
295           | osm | class   | type    | addr+interpolation | geometry |
296           | W1  | place   | houses  | even               | 1,2 |
297       When importing
298       Then W1 expands to no interpolation
299       When updating places
300           | osm | class | type  | housenr |
301           | N1  | place | house | 2       |
302           | N2  | place | house | 6       |
303       Then W1 expands to interpolation
304           | parent_place_id | start | end |
305           | W2              | 4     | 4   |
306
307     Scenario: housenumber added in middle of interpolation
308       Given the grid
309           | 1 |  |  |   |  | 2 |
310           | 3 |  |  | 4 |  | 5 |
311       And the places
312           | osm | class   | type         | name         | geometry |
313           | W1  | highway | unclassified | Cloud Street | 1, 2     |
314       And the ways
315           | id  | nodes |
316           | 2   | 3,4,5 |
317       And the places
318           | osm | class   | type    | addr+interpolation | geometry |
319           | W2  | place   | houses  | even    | 3,4,5    |
320       And the places
321           | osm | class | type  | housenr |
322           | N3  | place | house | 2       |
323           | N5  | place | house | 10      |
324       When importing
325       Then W2 expands to interpolation
326           | parent_place_id | start | end |
327           | W1              | 4     | 8  |
328       When updating places
329           | osm | class | type  | housenr |
330           | N4  | place | house | 6       |
331       Then W2 expands to interpolation
332           | parent_place_id | start | end |
333           | W1              | 4     | 4   |
334           | W1              | 8     | 8   |
335
336     @skip
337     Scenario: housenumber removed in middle of interpolation
338       Given the grid
339           | 1 |  |  |   |  | 2 |
340           | 3 |  |  | 4 |  | 5 |
341       And the places
342           | osm | class   | type         | name         | geometry |
343           | W1  | highway | unclassified | Cloud Street | 1, 2     |
344       And the ways
345           | id  | nodes |
346           | 2   | 3,4,5 |
347       And the places
348           | osm | class   | type    | addr+interpolation | geometry |
349           | W2  | place   | houses  | even    | 3,4,5    |
350       And the places
351           | osm | class | type  | housenr |
352           | N3  | place | house | 2       |
353           | N4  | place | house | 6       |
354           | N5  | place | house | 10      |
355       When importing
356       Then W2 expands to interpolation
357           | parent_place_id | start | end |
358           | W1              | 4     | 4   |
359           | W1              | 8     | 8   |
360       When marking for delete N4
361       Then W2 expands to interpolation
362           | parent_place_id | start | end |
363           | W1              | 4     | 8   |
364
365     Scenario: Change the start housenumber
366       Given the grid
367           | 1 |  | 2 |
368           | 3 |  | 4 |
369       And the places
370           | osm | class   | type         | name         | geometry |
371           | W1  | highway | unclassified | Cloud Street | 1, 2     |
372       And the ways
373           | id  | nodes |
374           | 2   | 3,4   |
375       And the places
376           | osm | class   | type    | addr+interpolation | geometry |
377           | W2  | place   | houses  | even    | 3,4      |
378       And the places
379           | osm | class | type  | housenr |
380           | N3  | place | house | 2       |
381           | N4  | place | house | 6       |
382       When importing
383       Then W2 expands to interpolation
384           | parent_place_id | start | end |
385           | W1              | 4     | 4   |
386       When updating places
387           | osm | class | type  | housenr |
388           | N4  | place | house | 8       |
389       Then W2 expands to interpolation
390           | parent_place_id | start | end |
391           | W1              | 4     | 6   |
392
393     Scenario: Legal interpolation type changed to illegal one
394       Given the grid
395           | 1 |  | 2 |
396           | 3 |  | 4 |
397       And the places
398           | osm | class   | type         | name         | geometry |
399           | W1  | highway | unclassified | Cloud Street | 1, 2     |
400       And the ways
401           | id  | nodes |
402           | 2   | 3,4   |
403       And the places
404           | osm | class   | type    | addr+interpolation | geometry |
405           | W2  | place   | houses  | even               | 3,4      |
406       And the places
407           | osm | class | type  | housenr |
408           | N3  | place | house | 2       |
409           | N4  | place | house | 6       |
410       When importing
411       Then W2 expands to interpolation
412           | parent_place_id | start | end |
413           | W1              | 4     | 4   |
414       When updating places
415           | osm | class   | type    | addr+interpolation | geometry |
416           | W2  | place   | houses  | 12-2               | 3,4      |
417       Then W2 expands to no interpolation
418