]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/update/parenting.feature
prepare release 5.1.0.post13
[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     # Invalidation of geometries currently disabled for addr:place matches.
113     @skip
114     Scenario: Housenumber is reparented when place is renamed to matching addr:place
115         Given the grid
116          | 1 |    |   | 2 |
117          |   | 10 | 4 |   |
118          |   |    |   |   |
119          |   |    | 5 |   |
120         And the places
121          | osm | class   | type        | name     | geometry |
122          | W1  | highway | residential | A street | 1,2      |
123          | N5  | place   | village     | Bdorf    | 5        |
124          | N4  | place   | village     | Other    | 4        |
125         And the places
126          | osm | class    | type | housenr | addr_place | geometry |
127          | N1  | building | yes  | 3       | Cdorf      | 10       |
128         When importing
129         Then placex contains
130          | object | parent_place_id |
131          | N1     | N4              |
132         When updating places
133          | osm | class   | type        | name     | geometry |
134          | N5  | place   | village     | Cdorf    | 5        |
135         Then placex contains
136          | object | parent_place_id |
137          | N1     | N5              |
138
139
140     Scenario: Housenumber is reparented when it looses a matching addr:place
141         Given the grid
142          | 1 |    |   | 2 |
143          |   | 10 | 4 |   |
144          |   |    |   |   |
145          |   |    | 5 |   |
146         And the places
147          | osm | class   | type        | name     | geometry |
148          | W1  | highway | residential | A street | 1,2      |
149          | N5  | place   | village     | Bdorf    | 5        |
150          | N4  | place   | village     | Other    | 4        |
151         And the places
152          | osm | class    | type | housenr | addr_place | geometry |
153          | N1  | building | yes  | 3       | Bdorf      | 10       |
154         When importing
155         Then placex contains
156          | object | parent_place_id |
157          | N1     | N5              |
158         When updating places
159          | osm | class   | type        | name     | geometry |
160          | N5  | place   | village     | Cdorf    | 5        |
161         Then placex contains
162          | object | parent_place_id |
163          | N1     | N4              |