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