]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/osm2pgsql/update/postcodes.feature
Merge pull request #3422 from lonvia/drop-non-parented-interpolations
[nominatim.git] / test / bdd / osm2pgsql / update / postcodes.feature
1 @DB
2 Feature: Update of postcode only objects
3     Tests that changes to objects containing only a postcode are
4     propagated correctly.
5
6
7     Scenario: Adding a postcode-only node
8         When loading osm data
9             """
10             """
11         Then place contains exactly
12             | object |
13
14         When updating osm data
15             """
16             n34 Tpostcode=4456
17             """
18         Then place contains exactly
19             | object    | type     |
20             | N34:place | postcode |
21         When indexing
22         Then placex contains exactly
23             | object |
24
25
26     Scenario: Deleting a postcode-only node
27         When loading osm data
28             """
29             n34 Tpostcode=4456
30             """
31         Then place contains exactly
32             | object    | type     |
33             | N34:place | postcode |
34
35         When updating osm data
36             """
37             n34 v2 dD
38             """
39         Then place contains exactly
40             | object |
41         When indexing
42         Then placex contains exactly
43             | object |
44
45
46     Scenario Outline: Converting a regular object into a postcode-only node
47         When loading osm data
48             """
49             n34 T<class>=<type>
50             """
51         Then place contains exactly
52             | object      | type   |
53             | N34:<class> | <type> |
54
55         When updating osm data
56             """
57             n34 Tpostcode=4456
58             """
59         Then place contains exactly
60             | object    | type     |
61             | N34:place | postcode |
62         When indexing
63         Then placex contains exactly
64             | object |
65
66         Examples:
67             | class   | type       |
68             | amenity | restaurant |
69             | place   | hamlet     |
70
71
72     Scenario Outline: Converting a postcode-only node into a regular object
73         When loading osm data
74             """
75             n34 Tpostcode=4456
76             """
77         Then place contains exactly
78             | object    | type     |
79             | N34:place | postcode |
80
81         When updating osm data
82             """
83             n34 T<class>=<type>
84             """
85         Then place contains exactly
86             | object      | type   |
87             | N34:<class> | <type> |
88         When indexing
89         Then placex contains exactly
90             | object      | type   |
91             | N34:<class> | <type> |
92
93         Examples:
94             | class   | type       |
95             | amenity | restaurant |
96             | place   | hamlet     |
97
98
99     Scenario: Converting na interpolation into a postcode-only node
100         Given the grid
101             | 1 | 2 |
102         When loading osm data
103             """
104             n1 Taddr:housenumber=3
105             n2 Taddr:housenumber=17
106             w34 Taddr:interpolation=odd Nn1,n2
107             """
108         Then place contains exactly
109             | object    | type   |
110             | N1:place  | house  |
111             | N2:place  | house  |
112             | W34:place | houses |
113
114         When updating osm data
115             """
116             w34 Tpostcode=4456 Nn1,n2
117             """
118         Then place contains exactly
119             | object    | type     |
120             | N1:place  | house    |
121             | N2:place  | house    |
122             | W34:place | postcode |
123         When indexing
124         Then location_property_osmline contains exactly
125             | object |
126         And placex contains exactly
127             | object    | type   |
128             | N1:place  | house  |
129             | N2:place  | house  |
130
131
132     Scenario: Converting a postcode-only node into an interpolation
133         Given the grid
134             | 1 | 2 |
135         When loading osm data
136             """
137             n1 Taddr:housenumber=3
138             n2 Taddr:housenumber=17
139             w33 Thighway=residential Nn1,n2
140             w34 Tpostcode=4456 Nn1,n2
141             """
142         Then place contains exactly
143             | object    | type     |
144             | N1:place  | house    |
145             | N2:place  | house    |
146             | W33:highway | residential |
147             | W34:place | postcode |
148
149         When updating osm data
150             """
151             w34 Taddr:interpolation=odd Nn1,n2
152             """
153         Then place contains exactly
154             | object    | type   |
155             | N1:place  | house  |
156             | N2:place  | house  |
157             | W33:highway | residential |
158             | W34:place | houses |
159         When indexing
160         Then location_property_osmline contains exactly
161             | object |
162             | 34:5   |
163         And placex contains exactly
164             | object    | type   |
165             | N1:place  | house  |
166             | N2:place  | house  |
167             | W33:highway | residential |