2 Feature: Import into placex
3 Tests that data in placex is completed correctly.
5 Scenario: No country code tag is available
7 | osm | class | type | geometry |
8 | N1 | highway | primary | country:us |
11 | object | addr+country | country_code |
14 Scenario: Location overwrites country code tag
15 Given the named places
16 | osm | class | type | country | geometry |
17 | N1 | highway | primary | de | country:us |
20 | object | addr+country | country_code |
23 Scenario: Country code tag overwrites location for countries
24 Given the named places
25 | osm | class | type | admin | country | geometry |
26 | R1 | boundary | administrative | 2 | de | (-100 40, -101 40, -101 41, -100 41, -100 40) |
29 | object | rank_search| addr+country | country_code |
32 Scenario: Illegal country code tag for countries is ignored
33 Given the named places
34 | osm | class | type | admin | country | geometry |
35 | R1 | boundary | administrative | 2 | xx | (-100 40, -101 40, -101 41, -100 41, -100 40) |
38 | object | addr+country | country_code |
41 Scenario: admin level is copied over
42 Given the named places
43 | osm | class | type | admin |
44 | N1 | place | state | 3 |
47 | object | admin_level |
50 Scenario: postcode node without postcode is dropped
52 | osm | class | type | name+ref |
53 | N1 | place | postcode | 12334 |
55 Then placex has no entry for N1
57 Scenario: postcode boundary without postcode is dropped
59 | osm | class | type | name+ref | geometry |
60 | R1 | boundary | postal_code | 554476 | poly-area:0.1 |
62 Then placex has no entry for R1
64 Scenario: search and address ranks for GB post codes correctly assigned
66 | osm | class | type | postcode | geometry |
67 | N1 | place | postcode | E45 2CD | country:gb |
68 | N2 | place | postcode | E45 2 | country:gb |
69 | N3 | place | postcode | Y45 | country:gb |
72 | object | postcode | country_code | rank_search | rank_address |
73 | N1 | E45 2CD | gb | 25 | 0 |
74 | N2 | E45 2 | gb | 23 | 0 |
75 | N3 | Y45 | gb | 21 | 0 |
77 Scenario: wrongly formatted GB postcodes are down-ranked
79 | osm | class | type | postcode | geometry |
80 | N1 | place | postcode | EA452CD | country:gb |
81 | N2 | place | postcode | E45 23 | country:gb |
84 | object | country_code | rank_search | rank_address |
88 Scenario: search and address rank for DE postcodes correctly assigned
90 | osm | class | type | postcode | geometry |
91 | N1 | place | postcode | 56427 | country:de |
92 | N2 | place | postcode | 5642 | country:de |
93 | N3 | place | postcode | 5642A | country:de |
94 | N4 | place | postcode | 564276 | country:de |
97 | object | country_code | rank_search | rank_address |
103 Scenario: search and address rank for other postcodes are correctly assigned
105 | osm | class | type | postcode | geometry |
106 | N1 | place | postcode | 1 | country:ca |
107 | N2 | place | postcode | X3 | country:ca |
108 | N3 | place | postcode | 543 | country:ca |
109 | N4 | place | postcode | 54dc | country:ca |
110 | N5 | place | postcode | 12345 | country:ca |
111 | N6 | place | postcode | 55TT667 | country:ca |
112 | N7 | place | postcode | 123-65 | country:ca |
113 | N8 | place | postcode | 12 445 4 | country:ca |
114 | N9 | place | postcode | A1:bc10 | country:ca |
117 | object | country_code | rank_search | rank_address |
128 Scenario: search and address ranks for places are correctly assigned
129 Given the named places
130 | osm | class | type |
132 | N11 | place | Continent |
133 | N12 | place | continent |
134 | N13 | place | sea |
135 | N14 | place | country |
136 | N15 | place | state |
137 | N16 | place | region |
138 | N17 | place | county |
139 | N18 | place | city |
140 | N19 | place | island |
141 | N20 | place | town |
142 | N21 | place | village |
143 | N22 | place | hamlet |
144 | N23 | place | municipality |
145 | N24 | place | district |
146 | N26 | place | borough |
147 | N27 | place | suburb |
148 | N28 | place | croft |
149 | N29 | place | subdivision |
150 | N30 | place | isolated_dwelling |
151 | N31 | place | farm |
152 | N32 | place | locality |
153 | N33 | place | islet |
154 | N34 | place | mountain_pass |
155 | N35 | place | neighbourhood |
156 | N36 | place | house |
157 | N37 | place | building |
158 | N38 | place | houses |
160 | osm | class | type | extra+capital |
161 | N101 | place | city | yes |
164 | object | rank_search | rank_address |
195 Scenario: search and address ranks for boundaries are correctly assigned
196 Given the named places
197 | osm | class | type |
198 | N1 | boundary | administrative |
200 | osm | class | type | geometry |
201 | W10 | boundary | administrative | 10 10, 11 11 |
203 | osm | class | type | admin | geometry |
204 | R20 | boundary | administrative | 2 | (1 1, 2 2, 1 2, 1 1) |
205 | R21 | boundary | administrative | 32 | (3 3, 4 4, 3 4, 3 3) |
206 | R22 | boundary | nature_park | 6 | (0 0, 1 0, 0 1, 0 0) |
207 | R23 | boundary | natural_reserve| 10 | (0 0, 1 1, 1 0, 0 0) |
209 | osm | class | type | geometry |
210 | R40 | place | country | (1 1, 2 2, 1 2, 1 1) |
211 | R41 | place | state | (3 3, 4 4, 3 4, 3 3) |
213 Then placex has no entry for N1
214 And placex has no entry for W10
216 | object | rank_search | rank_address |
224 Scenario: search and address ranks for highways correctly assigned
225 Given the scene roads-with-pois
227 | osm | class | type |
228 | N1 | highway | bus_stop |
230 | osm | class | type | geometry |
231 | W1 | highway | primary | :w-south |
232 | W2 | highway | secondary | :w-south |
233 | W3 | highway | tertiary | :w-south |
234 | W4 | highway | residential | :w-north |
235 | W5 | highway | unclassified | :w-north |
236 | W6 | highway | something | :w-north |
239 | object | rank_search | rank_address |
248 Scenario: rank and inclusion of landuses
249 Given the named places
250 | osm | class | type |
251 | N2 | landuse | residential |
253 | osm | class | type | geometry |
254 | W2 | landuse | residential | 1 1, 1 1.1 |
255 | W4 | landuse | residential | poly-area:0.1 |
256 | R2 | landuse | residential | poly-area:0.05 |
257 | R3 | landuse | forrest | poly-area:0.5 |
260 | object | rank_search | rank_address |
267 Scenario: rank and inclusion of naturals
268 Given the named places
269 | osm | class | type |
270 | N2 | natural | peak |
271 | N4 | natural | volcano |
272 | N5 | natural | foobar |
274 | osm | class | type | geometry |
275 | W2 | natural | mountain_range | 12 12,11 11 |
276 | W3 | natural | foobar | 13 13,13.1 13 |
277 | R3 | natural | volcano | poly-area:0.1 |
278 | R4 | natural | foobar | poly-area:0.5 |
279 | R5 | natural | sea | poly-area:5.0 |
280 | R6 | natural | sea | poly-area:0.01 |
283 | object | rank_search | rank_address |
294 Scenario: boundary ways for countries and states are ignored
295 Given the named places
296 | osm | class | type | admin | geometry |
297 | W4 | boundary | administrative | 2 | poly-area:0.1 |
298 | R4 | boundary | administrative | 2 | poly-area:0.1 |
299 | W5 | boundary | administrative | 3 | poly-area:0.1 |
300 | R5 | boundary | administrative | 3 | poly-area:0.1 |
301 | W6 | boundary | administrative | 4 | poly-area:0.1 |
302 | R6 | boundary | administrative | 4 | poly-area:0.1 |
303 | W7 | boundary | administrative | 5 | poly-area:0.1 |
304 | R7 | boundary | administrative | 5 | poly-area:0.1 |
306 Then placex contains exactly