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