]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/osm2pgsql/update/relation.feature
don't delete names on unknown country boundaries
[nominatim.git] / test / bdd / osm2pgsql / update / relation.feature
1 @DB
2 Feature: Update of relations by osm2pgsql
3     Testing relation update by osm2pgsql.
4
5     Scenario: Remove all members of a relation
6         When loading osm data
7           """
8           n1 Tamenity=prison,name=foo
9           n200 x0 y0
10           n201 x0 y0.0001
11           n202 x0.0001 y0.0001
12           n203 x0.0001 y0
13           w2 Tref=45' Nn200,n201,n202,n203,n200
14           r1 Ttype=multipolygon,tourism=hotel,name=XZ' Mw2@
15           """
16         Then place contains
17           | object | class   | type   | name
18           | R1     | tourism | hotel  | 'name' : 'XZ'
19           When updating osm data
20             """
21             r1 Ttype=multipolygon,tourism=hotel,name=XZ Mn1@
22             """
23         Then place has no entry for R1
24
25
26     Scenario: Change type of a relation
27         When loading osm data
28           """
29           n200 x0 y0
30           n201 x0 y0.0001
31           n202 x0.0001 y0.0001
32           n203 x0.0001 y0
33           w2 Tref=45 Nn200,n201,n202,n203,n200
34           r1 Ttype=multipolygon,tourism=hotel,name=XZ Mw2@
35           """
36         Then place contains
37           | object | class   | type   | name
38           | R1     | tourism | hotel  | 'name' : 'XZ'
39         When updating osm data
40           """
41           r1 Ttype=multipolygon,amenity=prison,name=XZ Mw2@
42           """
43         Then place has no entry for R1:tourism
44         And place contains
45           | object | class   | type   | name
46           | R1     | amenity | prison | 'name' : 'XZ'
47
48     Scenario: Change name of a relation
49         When loading osm data
50           """
51           n200 x0 y0
52           n201 x0 y0.0001
53           n202 x0.0001 y0.0001
54           n203 x0.0001 y0
55           w2 Tref=45 Nn200,n201,n202,n203,n200
56           r1 Ttype=multipolygon,tourism=hotel,name=AB Mw2@
57           """
58         Then place contains
59           | object | class   | type   | name
60           | R1     | tourism | hotel  | 'name' : 'AB'
61         When updating osm data
62           """
63           r1 Ttype=multipolygon,tourism=hotel,name=XY Mw2@
64           """
65         Then place contains
66           | object | class   | type   | name
67           | R1     | tourism | hotel  | 'name' : 'XZ'
68
69     Scenario: Change type of a relation into something unknown
70         When loading osm data
71           """
72           n200 x0 y0
73           n201 x0 y0.0001
74           n202 x0.0001 y0.0001
75           n203 x0.0001 y0
76           w2 Tref=45 Nn200,n201,n202,n203,n200
77           r1 Ttype=multipolygon,tourism=hotel,name=XY Mw2@
78           """
79         Then place contains
80           | object | class   | type   | name
81           | R1     | tourism | hotel  | 'name' : 'XZ'
82         When updating osm data
83           """
84           r1 Ttype=multipolygon,amenities=prison,name=XY Mw2@
85           """
86         Then place has no entry for R1
87
88     Scenario: Type tag is removed
89         When loading osm data
90           """
91           n200 x0 y0
92           n201 x0 y0.0001
93           n202 x0.0001 y0.0001
94           n203 x0.0001 y0
95           w2 Tref=45 Nn200,n201,n202,n203,n200
96           r1 Ttype=multipolygon,tourism=hotel,name=XY Mw2@
97           """
98         Then place contains
99           | object | class   | type   | name
100           | R1     | tourism | hotel  | 'name' : 'XZ'
101         When updating osm data
102           """
103           r1 Ttourism=hotel,name=XY Mw2@
104           """
105         Then place has no entry for R1
106
107     Scenario: Type tag is renamed to something unknown
108         When loading osm data
109           """
110           n200 x0 y0
111           n201 x0 y0.0001
112           n202 x0.0001 y0.0001
113           n203 x0.0001 y0
114           w2 Tref=45 Nn200,n201,n202,n203,n200
115           r1 Ttype=multipolygon,tourism=hotel,name=XY Mw2@
116           """
117         Then place contains
118           | object | class   | type   | name
119           | R1     | tourism | hotel  | 'name' : 'XZ'
120         When updating osm data
121           """
122           r1 Ttype=multipolygonn,tourism=hotel,name=XY Mw2@
123           """
124         Then place has no entry for R1
125
126     Scenario: Country boundary names are left untouched when country_code unknown
127         When loading osm data
128           """
129           n200 Tamenity=prison x0 y0
130           n201 x0 y0.0001
131           n202 x0.0001 y0.0001
132           n203 x0.0001 y0
133           """
134         And updating osm data
135           """
136           w1 Nn200,n201,n202,n203,n200
137           r1 Ttype=boundary,boundary=administrative,name=Foo,country_code=XX,admin_level=2 Mw1@
138           """
139         Then place contains
140           | object | country_code | name           |
141           | R1     | XX           | 'name' : 'Foo' |
142
143     Scenario: Country boundary names are extended when country_code known
144         When loading osm data
145           """
146           n200 Tamenity=prison x0 y0
147           n201 x0 y0.0001
148           n202 x0.0001 y0.0001
149           n203 x0.0001 y0
150           """
151         And updating osm data
152           """
153           w1 Nn200,n201,n202,n203,n200
154           r1 Ttype=boundary,boundary=administrative,name=Foo,country_code=ch,admin_level=2 Mw1@
155           """
156         Then place contains
157             | object | country_code | name+name:de | name+name |
158             | R1     | ch           | Schweiz      | Foo       |
159