]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/update/parenting.feature
prepare release 5.3.2.post2
[nominatim.git] / test / bdd / features / db / update / parenting.feature
1 Feature: Update parenting of objects
2
3     Scenario: POI inside building inherits addr:street change
4         Given the grid
5          | 10 |  |   |  |   |   |   | 11 |
6          |    |  | 5 |  |   | 6 |   |    |
7          |    |  |   |  |   |   |   |    |
8          |    |  |   |  | 1 |   |   |    |
9          | 12 |  | 8 |  |   | 7 |   |    |
10         And the named places
11          | osm | class   | type  |
12          | N1  | amenity | bank  |
13         And the places
14          | osm | class    | type | street  | housenr | geometry |
15          | W1  | building | yes  | nowhere | 3       | (5,6,7,8,5) |
16         And the places
17          | osm | class    | type        | name | geometry |
18          | W2  | highway  | primary     | bar  | 10,11 |
19          | W3  | highway  | residential | foo  | 10,12 |
20         When importing
21         Then placex contains
22          | object | parent_place_id | housenumber |
23          | W1     | W2              | 3 |
24          | N1     | W2              | 3 |
25         When updating places
26          | osm | class    | type | street | addr_place | housenr | geometry    |
27          | W1  | building | yes  | foo    | nowhere    | 3       | (5,6,7,8,5) |
28         And updating places
29          | osm | class   | type | name |
30          | N1  | amenity | bank | well |
31         Then placex contains
32          | object | parent_place_id | housenumber |
33          | W1     | W3              | 3 |
34          | N1     | W3              | 3 |
35
36
37     Scenario: Housenumber is reparented when street gets name matching addr:street
38         Given the grid
39          | 1 |    |   | 2 |
40          |   | 10 |   |   |
41          |   |    |   |   |
42          | 3 |    |   | 4 |
43         And the places
44          | osm | class   | type        | name     | geometry |
45          | W1  | highway | residential | A street | 1,2      |
46          | W2  | highway | residential | B street | 3,4      |
47         And the places
48          | osm | class    | type | housenr | street   | geometry |
49          | N1  | building | yes  | 3       | X street | 10       |
50         When importing
51         Then placex contains
52          | object | parent_place_id |
53          | N1     | W1              |
54         When updating places
55          | osm | class   | type        | name     | geometry |
56          | W2  | highway | residential | X street | 3,4      |
57         Then placex contains
58          | object | parent_place_id |
59          | N1     | W2              |
60
61
62     Scenario: Housenumber is reparented when street looses name matching addr:street
63         Given the grid
64          | 1 |    |   | 2 |
65          |   | 10 |   |   |
66          |   |    |   |   |
67          | 3 |    |   | 4 |
68         And the places
69          | osm | class   | type        | name     | geometry |
70          | W1  | highway | residential | A street | 1,2      |
71          | W2  | highway | residential | X street | 3,4      |
72         And the places
73          | osm | class    | type | housenr | street   | geometry |
74          | N1  | building | yes  | 3       | X street | 10       |
75         When importing
76         Then placex contains
77          | object | parent_place_id |
78          | N1     | W2              |
79         When updating places
80          | osm | class   | type        | name     | geometry |
81          | W2  | highway | residential | B street | 3,4      |
82         Then placex contains
83          | object | parent_place_id |
84          | N1     | W1              |
85
86
87     Scenario: Housenumber is reparented when street gets name matching addr:street
88         Given the grid
89          | 1 |    |   | 2 |
90          |   | 10 |   |   |
91          |   |    |   |   |
92          | 3 |    |   | 4 |
93         And the places
94          | osm | class   | type        | name     | geometry |
95          | W1  | highway | residential | A street | 1,2      |
96          | W2  | highway | residential | B street | 3,4      |
97         And the places
98          | osm | class    | type | housenr | street   | geometry |
99          | N1  | building | yes  | 3       | X street | 10       |
100         When importing
101         Then placex contains
102          | object | parent_place_id |
103          | N1     | W1              |
104         When updating places
105          | osm | class   | type        | name     | geometry |
106          | W2  | highway | residential | X street | 3,4      |
107         Then placex contains
108          | object | parent_place_id |
109          | N1     | W2              |
110
111
112     Scenario: Housenumber is reparented when place is renamed to matching addr:place
113         Given the grid
114          | 1 |    |   | 2 |
115          |   | 10 | 4 |   |
116          |   |    |   |   |
117          |   |    | 5 |   |
118         And the places
119          | osm | class   | type        | name     | geometry |
120          | W1  | highway | residential | A street | 1,2      |
121          | N5  | place   | village     | Bdorf    | 5        |
122          | N4  | place   | village     | Other    | 4        |
123         And the places
124          | osm | class    | type | housenr | addr_place | geometry |
125          | N1  | building | yes  | 3       | Cdorf      | 10       |
126         When importing
127         Then placex contains
128          | object | parent_place_id |
129          | N1     | N4              |
130         When updating places
131          | osm | class   | type        | name     | geometry |
132          | N5  | place   | village     | Cdorf    | 5        |
133         Then placex contains
134          | object | parent_place_id |
135          | N1     | N5              |
136
137
138     Scenario: Housenumber is reparented when it looses a matching addr:place
139         Given the grid
140          | 1 |    |   | 2 |
141          |   | 10 | 4 |   |
142          |   |    |   |   |
143          |   |    | 5 |   |
144         And the places
145          | osm | class   | type        | name     | geometry |
146          | W1  | highway | residential | A street | 1,2      |
147          | N5  | place   | village     | Bdorf    | 5        |
148          | N4  | place   | village     | Other    | 4        |
149         And the places
150          | osm | class    | type | housenr | addr_place | geometry |
151          | N1  | building | yes  | 3       | Bdorf      | 10       |
152         When importing
153         Then placex contains
154          | object | parent_place_id |
155          | N1     | N5              |
156         When updating places
157          | osm | class   | type        | name     | geometry |
158          | N5  | place   | village     | Cdorf    | 5        |
159         Then placex contains
160          | object | parent_place_id |
161          | N1     | N4              |
162
163
164     Scenario: House re-parented when added to an associatedStreet relation
165         Given the grid
166          | 10 |   |   |   |   | 11 |
167          |    | 1 |   |   |   |    |
168          |    |   |   |   |   |    |
169          | 12 |   |   |   |   |    |
170         And the places
171          | osm | class | type  |
172          | N1  | place | house |
173         And the places
174          | osm | class   | type        | name | geometry |
175          | W1  | highway | residential | foo  | 10,11    |
176          | W2  | highway | residential | bar  | 10,12    |
177         And the relations
178          | id | members   | tags+type        |
179          | 1  | W1:street | associatedStreet |
180         When importing
181         Then placex contains
182          | object | parent_place_id |
183          | N1     | W1              |
184         When updating relations
185          | id | members             | tags+type        |
186          | 1  | W2:street,N1:house  | associatedStreet |
187         Then placex contains
188          | object | parent_place_id |
189          | N1     | W2              |
190
191
192     Scenario: House reverts to nearest street when removed from associatedStreet relation
193         Given the grid
194          | 10 |   |   |   |   | 11 |
195          |    |   |   |   |   |    |
196          |    |   |   |   |   |    |
197          |    |   |   |   |   |    |
198          | 12 | 1 |   |   |   |    |
199         And the places
200          | osm | class | type  |
201          | N1  | place | house |
202         And the places
203          | osm | class   | type        | name | geometry |
204          | W1  | highway | residential | foo  | 10,11    |
205          | W2  | highway | residential | bar  | 10,12    |
206         And the relations
207          | id | members             | tags+type        |
208          | 1  | W1:street,N1:house  | associatedStreet |
209         When importing
210         Then placex contains
211          | object | parent_place_id |
212          | N1     | W1              |
213         When updating relations
214          | id | members   | tags+type        |
215          | 1  | W1:street | associatedStreet |
216         Then placex contains
217          | object | parent_place_id |
218          | N1     | W2              |
219
220
221     Scenario: Houses re-parented when street member of relation changes
222         Given the grid
223          | 10 |   |   |   |   | 11 |
224          |    | 1 |   |   |   |    |
225          |    |   |   |   |   |    |
226          | 12 |   |   |   |   |    |
227         And the places
228          | osm | class | type  |
229          | N1  | place | house |
230         And the places
231          | osm | class   | type        | name | geometry |
232          | W1  | highway | residential | foo  | 10,11    |
233          | W2  | highway | residential | bar  | 10,12    |
234         And the relations
235          | id | members             | tags+type        |
236          | 1  | W1:street,N1:house  | associatedStreet |
237         When importing
238         Then placex contains
239          | object | parent_place_id |
240          | N1     | W1              |
241         When updating relations
242          | id | members             | tags+type        |
243          | 1  | W2:street,N1:house  | associatedStreet |
244         Then placex contains
245          | object | parent_place_id |
246          | N1     | W2              |
247