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