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