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 | country_code | calculated_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 | country_code | calculated_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 | country_code | calculated_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 | country_code | calculated_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: admin level is default 15
51 Given the named places
52 | osm | class | type |
53 | N1 | amenity | prison |
56 | object | admin_level |
59 Scenario: admin level is never larger than 15
60 Given the named places
61 | osm | class | type | admin |
62 | N1 | amenity | prison | 16 |
65 | object | admin_level |
68 Scenario: postcode node without postcode is dropped
70 | osm | class | type | name+ref |
71 | N1 | place | postcode | 12334 |
73 Then placex has no entry for N1
75 Scenario: postcode boundary without postcode is dropped
77 | osm | class | type | name+ref | geometry |
78 | R1 | boundary | postal_code | 554476 | poly-area:0.1 |
80 Then placex has no entry for R1
82 Scenario: search and address ranks for GB post codes correctly assigned
84 | osm | class | type | postcode | geometry |
85 | N1 | place | postcode | E45 2CD | country:gb |
86 | N2 | place | postcode | E45 2 | country:gb |
87 | N3 | place | postcode | Y45 | country:gb |
90 | object | postcode | calculated_country_code | rank_search | rank_address |
91 | N1 | E45 2CD | gb | 25 | 5 |
92 | N2 | E45 2 | gb | 23 | 5 |
93 | N3 | Y45 | gb | 21 | 5 |
95 Scenario: wrongly formatted GB postcodes are down-ranked
97 | osm | class | type | postcode | geometry |
98 | N1 | place | postcode | EA452CD | country:gb |
99 | N2 | place | postcode | E45 23 | country:gb |
100 | N3 | place | postcode | y45 | country:gb |
103 | object | calculated_country_code | rank_search | rank_address |
104 | N1 | gb | 30 | 30 |
105 | N2 | gb | 30 | 30 |
106 | N3 | gb | 30 | 30 |
108 Scenario: search and address rank for DE postcodes correctly assigned
110 | osm | class | type | postcode | geometry |
111 | N1 | place | postcode | 56427 | country:de |
112 | N2 | place | postcode | 5642 | country:de |
113 | N3 | place | postcode | 5642A | country:de |
114 | N4 | place | postcode | 564276 | country:de |
117 | object | calculated_country_code | rank_search | rank_address |
118 | N1 | de | 21 | 11 |
119 | N2 | de | 30 | 30 |
120 | N3 | de | 30 | 30 |
121 | N4 | de | 30 | 30 |
123 Scenario: search and address rank for other postcodes are correctly assigned
125 | osm | class | type | postcode | geometry |
126 | N1 | place | postcode | 1 | country:ca |
127 | N2 | place | postcode | X3 | country:ca |
128 | N3 | place | postcode | 543 | country:ca |
129 | N4 | place | postcode | 54dc | country:ca |
130 | N5 | place | postcode | 12345 | country:ca |
131 | N6 | place | postcode | 55TT667 | country:ca |
132 | N7 | place | postcode | 123-65 | country:ca |
133 | N8 | place | postcode | 12 445 4 | country:ca |
134 | N9 | place | postcode | A1:bc10 | country:ca |
137 | object | calculated_country_code | rank_search | rank_address |
138 | N1 | ca | 21 | 11 |
139 | N2 | ca | 21 | 11 |
140 | N3 | ca | 21 | 11 |
141 | N4 | ca | 21 | 11 |
142 | N5 | ca | 21 | 11 |
143 | N6 | ca | 21 | 11 |
144 | N7 | ca | 25 | 11 |
145 | N8 | ca | 25 | 11 |
146 | N9 | ca | 25 | 11 |
148 Scenario: search and address ranks for places are correctly assigned
149 Given the named places
150 | osm | class | type |
152 | N11 | place | Continent |
153 | N12 | place | continent |
154 | N13 | place | sea |
155 | N14 | place | country |
156 | N15 | place | state |
157 | N16 | place | region |
158 | N17 | place | county |
159 | N18 | place | city |
160 | N19 | place | island |
161 | N20 | place | town |
162 | N21 | place | village |
163 | N22 | place | hamlet |
164 | N23 | place | municipality |
165 | N24 | place | district |
166 | N25 | place | unincorporated_area |
167 | N26 | place | borough |
168 | N27 | place | suburb |
169 | N28 | place | croft |
170 | N29 | place | subdivision |
171 | N30 | place | isolated_dwelling |
172 | N31 | place | farm |
173 | N32 | place | locality |
174 | N33 | place | islet |
175 | N34 | place | mountain_pass |
176 | N35 | place | neighbourhood |
177 | N36 | place | house |
178 | N37 | place | building |
179 | N38 | place | houses |
181 | osm | class | type | extra+locality |
182 | N100 | place | locality | townland |
184 | osm | class | type | extra+capital |
185 | N101 | place | city | yes |
188 | object | rank_search | rank_address |
221 Scenario: search and address ranks for boundaries are correctly assigned
222 Given the named places
223 | osm | class | type |
224 | N1 | boundary | administrative |
226 | osm | class | type | geometry |
227 | W10 | boundary | administrative | 10 10, 11 11 |
229 | osm | class | type | admin | geometry |
230 | R20 | boundary | administrative | 2 | (1 1, 2 2, 1 2, 1 1) |
231 | R21 | boundary | administrative | 32 | (3 3, 4 4, 3 4, 3 3) |
232 | R22 | boundary | nature_park | 6 | (0 0, 1 0, 0 1, 0 0) |
233 | R23 | boundary | natural_reserve| 10 | (0 0, 1 1, 1 0, 0 0) |
235 Then placex has no entry for N1
236 And placex has no entry for W10
238 | object | rank_search | rank_address |
244 Scenario: search and address ranks for highways correctly assigned
245 Given the scene roads-with-pois
247 | osm | class | type |
248 | N1 | highway | bus_stop |
250 | osm | class | type | geometry |
251 | W1 | highway | primary | :w-south |
252 | W2 | highway | secondary | :w-south |
253 | W3 | highway | tertiary | :w-south |
254 | W4 | highway | residential | :w-north |
255 | W5 | highway | unclassified | :w-north |
256 | W6 | highway | something | :w-north |
259 | object | rank_search | rank_address |
268 Scenario: rank and inclusion of landuses
269 Given the named places
270 | osm | class | type |
271 | N2 | landuse | residential |
273 | osm | class | type | geometry |
274 | W2 | landuse | residential | 1 1, 1 1.1 |
275 | W4 | landuse | residential | poly-area:0.1 |
276 | R2 | landuse | residential | poly-area:0.05 |
277 | R3 | landuse | forrest | poly-area:0.5 |
280 | object | rank_search | rank_address |
287 Scenario: rank and inclusion of naturals
288 Given the named places
289 | osm | class | type |
290 | N2 | natural | peak |
291 | N4 | natural | volcano |
292 | N5 | natural | foobar |
294 | osm | class | type | geometry |
295 | W2 | natural | mountain_range | 12 12,11 11 |
296 | W3 | natural | foobar | 13 13,13.1 13 |
297 | R3 | natural | volcano | poly-area:0.1 |
298 | R4 | natural | foobar | poly-area:0.5 |
299 | R5 | natural | sea | poly-area:5.0 |
300 | R6 | natural | sea | poly-area:0.01 |
303 | object | rank_search | rank_address |