]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/update/parenting.feature
bdd: move update tests from scenes to grid descriptions
[nominatim.git] / test / bdd / db / update / parenting.feature
1 @DB
2 Feature: Update parenting of objects
3
4     Scenario: POI inside building inherits addr:street change
5         Given the grid
6          | 10 |  |   |  |   |   |   | 11 |
7          |    |  | 5 |  |   | 6 |   |    |
8          |    |  |   |  |   |   |   |    |
9          |    |  |   |  | 1 |   |   |    |
10          | 12 |  | 8 |  |   | 7 |   |    |
11         And the named places
12          | osm | class   | type  |
13          | N1  | amenity | bank  |
14         And the places
15          | osm | class    | type | street  | housenr | geometry |
16          | W1  | building | yes  | nowhere | 3       | (5,6,7,8,5) |
17         And the places
18          | osm | class    | type        | name | geometry |
19          | W2  | highway  | primary     | bar  | 10,11 |
20          | W3  | highway  | residential | foo  | 10,12 |
21         When importing
22         Then placex contains
23          | object | parent_place_id | housenumber |
24          | W1     | W2              | 3 |
25          | N1     | W2              | 3 |
26         When updating places
27          | osm | class    | type | street | addr_place | housenr | geometry    |
28          | W1  | building | yes  | foo    | nowhere    | 3       | (5,6,7,8,5) |
29         And updating places
30          | osm | class   | type | name |
31          | N1  | amenity | bank | well |
32         Then placex contains
33          | object | parent_place_id | housenumber |
34          | W1     | W3              | 3 |
35          | N1     | W3              | 3 |
36
37
38     Scenario: Housenumber is reparented when street gets name matching addr:street
39         Given the grid
40          | 1 |    |   | 2 |
41          |   | 10 |   |   |
42          |   |    |   |   |
43          | 3 |    |   | 4 |
44         And the places
45          | osm | class   | type        | name     | geometry |
46          | W1  | highway | residential | A street | 1,2      |
47          | W2  | highway | residential | B street | 3,4      |
48         And the places
49          | osm | class    | type | housenr | street   | geometry |
50          | N1  | building | yes  | 3       | X street | 10       |
51         When importing
52         Then placex contains
53          | object | parent_place_id |
54          | N1     | W1              |
55         When updating places
56          | osm | class   | type        | name     | geometry |
57          | W2  | highway | residential | X street | 3,4      |
58         Then placex contains
59          | object | parent_place_id |
60          | N1     | W2              |
61
62
63     Scenario: Housenumber is reparented when street looses name matching addr:street
64         Given the grid
65          | 1 |    |   | 2 |
66          |   | 10 |   |   |
67          |   |    |   |   |
68          | 3 |    |   | 4 |
69         And the places
70          | osm | class   | type        | name     | geometry |
71          | W1  | highway | residential | A street | 1,2      |
72          | W2  | highway | residential | X street | 3,4      |
73         And the places
74          | osm | class    | type | housenr | street   | geometry |
75          | N1  | building | yes  | 3       | X street | 10       |
76         When importing
77         Then placex contains
78          | object | parent_place_id |
79          | N1     | W2              |
80         When updating places
81          | osm | class   | type        | name     | geometry |
82          | W2  | highway | residential | B street | 3,4      |
83         Then placex contains
84          | object | parent_place_id |
85          | N1     | W1              |
86
87
88     Scenario: Housenumber is reparented when street gets name matching addr:street
89         Given the grid
90          | 1 |    |   | 2 |
91          |   | 10 |   |   |
92          |   |    |   |   |
93          | 3 |    |   | 4 |
94         And the places
95          | osm | class   | type        | name     | geometry |
96          | W1  | highway | residential | A street | 1,2      |
97          | W2  | highway | residential | B street | 3,4      |
98         And the places
99          | osm | class    | type | housenr | street   | geometry |
100          | N1  | building | yes  | 3       | X street | 10       |
101         When importing
102         Then placex contains
103          | object | parent_place_id |
104          | N1     | W1              |
105         When updating places
106          | osm | class   | type        | name     | geometry |
107          | W2  | highway | residential | X street | 3,4      |
108         Then placex contains
109          | object | parent_place_id |
110          | N1     | W2              |
111
112
113     # Invalidation of geometries currently disabled for addr:place matches.
114     @Fail
115     Scenario: Housenumber is reparented when place is renamed to matching addr:place
116         Given the grid
117          | 1 |    |   | 2 |
118          |   | 10 | 4 |   |
119          |   |    |   |   |
120          |   |    | 5 |   |
121         And the places
122          | osm | class   | type        | name     | geometry |
123          | W1  | highway | residential | A street | 1,2      |
124          | N5  | place   | village     | Bdorf    | 5        |
125          | N4  | place   | village     | Other    | 4        |
126         And the places
127          | osm | class    | type | housenr | addr_place | geometry |
128          | N1  | building | yes  | 3       | Cdorf      | 10       |
129         When importing
130         Then placex contains
131          | object | parent_place_id |
132          | N1     | N4              |
133         When updating places
134          | osm | class   | type        | name     | geometry |
135          | N5  | place   | village     | Cdorf    | 5        |
136         Then placex contains
137          | object | parent_place_id |
138          | N1     | N5              |
139
140
141     Scenario: Housenumber is reparented when it looses a matching addr:place
142         Given the grid
143          | 1 |    |   | 2 |
144          |   | 10 | 4 |   |
145          |   |    |   |   |
146          |   |    | 5 |   |
147         And the places
148          | osm | class   | type        | name     | geometry |
149          | W1  | highway | residential | A street | 1,2      |
150          | N5  | place   | village     | Bdorf    | 5        |
151          | N4  | place   | village     | Other    | 4        |
152         And the places
153          | osm | class    | type | housenr | addr_place | geometry |
154          | N1  | building | yes  | 3       | Bdorf      | 10       |
155         When importing
156         Then placex contains
157          | object | parent_place_id |
158          | N1     | N5              |
159         When updating places
160          | osm | class   | type        | name     | geometry |
161          | N5  | place   | village     | Cdorf    | 5        |
162         Then placex contains
163          | object | parent_place_id |
164          | N1     | N4              |