]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/update/interpolation.feature
Merge pull request #600 from lonvia/behave-tests-rebased
[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     @wip
6     Scenario: new interpolation added to existing street
7       Given the scene parallel-road
8       And the places
9           | osm | class   | type         | name         | geometry |
10           | W2  | highway | unclassified | Sun Way      | :w-north |
11           | W3  | highway | unclassified | Cloud Street | :w-south |
12       And the ways
13           | id  | nodes |
14           | 10  | 1,100,101,102,2 |
15       When importing
16       Then W10 expands to no interpolation
17       When updating places
18           | osm | class | type  | housenr | geometry |
19           | N1  | place | house | 2       | :n-middle-w |
20           | N2  | place | house | 6       | :n-middle-e |
21           | W10 | place | houses | even   | :w-middle |
22       Then placex contains
23           | object | parent_place_id |
24           | N1     | W2 |
25           | N2     | W2 |
26       And W10 expands to interpolation
27           | parent_place_id | start | end |
28           | W2              | 2     | 6 |
29
30     Scenario: addr:street added to interpolation
31       Given the scene parallel-road
32       And the places
33           | osm | class | type  | housenr | geometry |
34           | N1  | place | house | 2       | :n-middle-w |
35           | N2  | place | house | 6       | :n-middle-e |
36           | W10 | place | houses | even   | :w-middle |
37       And the places
38           | osm | class   | type         | name         | geometry |
39           | W2  | highway | unclassified | Sun Way      | :w-north |
40           | W3  | highway | unclassified | Cloud Street | :w-south |
41       And the ways
42           | id  | nodes |
43           | 10  | 1,100,101,102,2 |
44       When importing
45       Then placex contains
46           | object | parent_place_id |
47           | N1     | W2 |
48           | N2     | W2 |
49       And W10 expands to interpolation
50           | parent_place_id | start | end |
51           | W2              | 2     | 6 |
52       When updating places
53           | osm | class   | type    | housenr | street       | geometry |
54           | W10 | place   | houses  | even    | Cloud Street | :w-middle |
55       Then placex contains
56           | object | parent_place_id |
57           | N1     | W3 |
58           | N2     | W3 |
59       And W10 expands to interpolation
60           | parent_place_id | start | end |
61           | W3              | 2     | 6 |
62
63     Scenario: addr:street added to housenumbers
64       Given the scene parallel-road
65       And the places
66           | osm | class | type  | housenr | geometry |
67           | N1  | place | house | 2       | :n-middle-w |
68           | N2  | place | house | 6       | :n-middle-e |
69           | W10 | place | houses | even   | :w-middle |
70       And the places
71           | osm | class   | type         | name         | geometry |
72           | W2  | highway | unclassified | Sun Way      | :w-north |
73           | W3  | highway | unclassified | Cloud Street | :w-south |
74       And the ways
75           | id  | nodes |
76           | 10  | 1,100,101,102,2 |
77       When importing
78       Then placex contains
79           | object | parent_place_id |
80           | N1     | W2 |
81           | N2     | W2 |
82       And W10 expands to interpolation
83           | parent_place_id | start | end |
84           | W2              | 2     | 6 |
85       When updating places
86           | osm | class | type  | street      | housenr | geometry |
87           | N1  | place | house | Cloud Street| 2       | :n-middle-w |
88           | N2  | place | house | Cloud Street| 6       | :n-middle-e |
89       Then placex contains
90           | object | parent_place_id |
91           | N1     | W3 |
92           | N2     | W3 |
93       And W10 expands to interpolation
94           | parent_place_id | start | end |
95           | W3              | 2     | 6 |
96
97     Scenario: interpolation tag removed
98       Given the scene parallel-road
99       And the places
100           | osm | class | type  | housenr | geometry |
101           | N1  | place | house | 2       | :n-middle-w |
102           | N2  | place | house | 6       | :n-middle-e |
103           | W10 | place | houses | even   | :w-middle |
104       And the places
105           | osm | class   | type         | name         | geometry |
106           | W2  | highway | unclassified | Sun Way      | :w-north |
107           | W3  | highway | unclassified | Cloud Street | :w-south |
108       And the ways
109           | id  | nodes |
110           | 10  | 1,100,101,102,2 |
111       When importing
112       Then placex contains
113           | object | parent_place_id |
114           | N1     | W2 |
115           | N2     | W2 |
116       And W10 expands to interpolation
117           | parent_place_id | start | end |
118           | W2              | 2     | 6 |
119       When marking for delete W10
120       Then W10 expands to no interpolation
121       And placex contains
122           | object | parent_place_id |
123           | N1     | W2 |
124           | N2     | W2 |
125
126     Scenario: referenced road added
127       Given the scene parallel-road
128       And the places
129           | osm | class | type  | housenr | geometry |
130           | N1  | place | house | 2       | :n-middle-w |
131           | N2  | place | house | 6       | :n-middle-e |
132       And the places
133           | osm | class   | type    | housenr | street      | geometry |
134           | W10 | place   | houses  | even    | Cloud Street| :w-middle |
135       And the places
136           | osm | class   | type         | name     | geometry |
137           | W2  | highway | unclassified | Sun Way  | :w-north |
138       And the ways
139           | id  | nodes |
140           | 10  | 1,100,101,102,2 |
141       When importing
142       Then placex contains
143           | object | parent_place_id |
144           | N1     | W2 |
145           | N2     | W2 |
146       And W10 expands to interpolation
147           | parent_place_id | start | end |
148           | W2              | 2     | 6 |
149       When updating places
150           | osm | class   | type         | name         | geometry |
151           | W3  | highway | unclassified | Cloud Street | :w-south |
152       Then placex contains
153           | object | parent_place_id |
154           | N1     | W3 |
155           | N2     | W3 |
156       And W10 expands to interpolation
157           | parent_place_id | start | end |
158           | W3              | 2     | 6 |
159
160     Scenario: referenced road deleted
161       Given the scene parallel-road
162       And the places
163           | osm | class | type  | housenr | geometry |
164           | N1  | place | house | 2       | :n-middle-w |
165           | N2  | place | house | 6       | :n-middle-e |
166       And the places
167           | osm | class   | type    | housenr | street      | geometry |
168           | W10 | place   | houses  | even    | Cloud Street| :w-middle |
169       And the places
170           | osm | class   | type         | name         | geometry |
171           | W2  | highway | unclassified | Sun Way      | :w-north |
172           | W3  | highway | unclassified | Cloud Street | :w-south |
173       And the ways
174           | id  | nodes |
175           | 10  | 1,100,101,102,2 |
176       When importing
177       Then placex contains
178           | object | parent_place_id |
179           | N1     | W3 |
180           | N2     | W3 |
181       And W10 expands to interpolation
182           | parent_place_id | start | end |
183           | W3              | 2     | 6 |
184       When marking for delete W3
185       Then placex contains
186           | object | parent_place_id |
187           | N1     | W2 |
188           | N2     | W2 |
189       And W10 expands to interpolation
190           | parent_place_id | start | end |
191           | W2              | 2     | 6 |
192
193     Scenario: building becomes interpolation
194       Given the scene building-with-parallel-streets
195       And the places
196           | osm | class    | type  | housenr | geometry |
197           | W1  | place    | house | 3       | :w-building |
198       And the places
199           | osm | class   | type         | name         | geometry |
200           | W2  | highway | unclassified | Cloud Street | :w-south |
201       When importing
202       Then placex contains
203           | object | parent_place_id |
204           | W1     | W2 |
205       Given the ways
206           | id  | nodes |
207           | 1   | 1,100,101,102,2 |
208       When updating places
209           | osm | class | type  | housenr | geometry |
210           | N1  | place | house | 2       | :n-north-w |
211           | N2  | place | house | 6       | :n-north-e |
212       And updating places
213           | osm | class   | type    | housenr | street      | geometry |
214           | W1  | place   | houses  | even    | Cloud Street| :w-north |
215       Then placex has no entry for W1
216       And W1 expands to interpolation
217           | parent_place_id | start | end |
218           | W2              | 2     | 6 |
219
220     Scenario: interpolation becomes building
221       Given the scene building-with-parallel-streets
222       And the places
223           | osm | class | type  | housenr | geometry |
224           | N1  | place | house | 2       | :n-north-w |
225           | N2  | place | house | 6       | :n-north-e |
226       And the places
227           | osm | class   | type         | name         | geometry |
228           | W2  | highway | unclassified | Cloud Street | :w-south |
229       And the ways
230           | id  | nodes |
231           | 1   | 1,100,101,102,2 |
232       And the places
233           | osm | class   | type    | housenr | street      | geometry |
234           | W1  | place   | houses  | even    | Cloud Street| :w-north |
235       When importing
236       Then placex has no entry for W1
237       And W1 expands to interpolation
238           | parent_place_id | start | end |
239           | W2              | 2     | 6 |
240       When updating places
241           | osm | class    | type  | housenr | geometry |
242           | W1  | place    | house | 3       | :w-building |
243       Then placex contains
244           | object | parent_place_id |
245           | W1     | W2 |
246
247     Scenario: housenumbers added to interpolation
248       Given the scene building-with-parallel-streets
249       And the places
250           | osm | class   | type         | name         | geometry |
251           | W2  | highway | unclassified | Cloud Street | :w-south |
252       And the ways
253           | id  | nodes |
254           | 1   | 1,100,101,102,2 |
255       And the places
256           | osm | class   | type    | housenr | geometry |
257           | W1  | place   | houses  | even    | :w-north |
258       When importing
259       Then W1 expands to no interpolation
260       When updating places
261           | osm | class | type  | housenr | geometry |
262           | N1  | place | house | 2       | :n-north-w |
263           | N2  | place | house | 6       | :n-north-e |
264       And updating places
265           | osm | class   | type    | housenr | street      | geometry |
266           | W1  | place   | houses  | even    | Cloud Street| :w-north |
267       Then W1 expands to interpolation
268           | parent_place_id | start | end |
269           | W2              | 2     | 6 |