2 Feature: Tag evaluation
3 Tests if tags are correctly imported into the place table
5 Scenario Outline: Name tags
8 | 1 | 'highway' : 'yes', '<nametag>' : 'Foo'
10 Then table place contains
12 | N1 | '<nametag>' : 'Foo'
51 Scenario Outline: Ignored name tags
54 | 1 | 'highway' : 'yes', '<nametag>' : 'Foo', 'name' : 'real'
56 Then table place contains
58 | N1 | 'name' : 'real'
70 Scenario: Special character in name tag
73 | 1 | 'highway' : 'yes', 'name: de' : 'Foo', 'name' : 'real'
74 | 2 | 'highway' : 'yes', 'name:\nde' : 'Foo', 'name' : 'real'
75 | 3 | 'highway' : 'yes', 'name:\tde' : 'Foo', 'name:\\' : 'real'
77 Then table place contains
79 | N1 | 'name:_de' : 'Foo', 'name' : 'real'
80 | N2 | 'name:_de' : 'Foo', 'name' : 'real'
81 | N3 | 'name:_de' : 'Foo', 'name:\\\\' : 'real'
83 Scenario Outline: Included places
86 | 1 | '<key>' : '<value>', 'name' : 'real'
88 Then table place contains
90 | N1 | 'name' : 'real'
95 | tourism | information
99 | highway | residential
100 | aerialway | station
102 | boundary | administrative
105 | leisure | playground
112 | mountain_pass | yes
115 Scenario Outline: Excluded places
118 | 1 | '<key>' : '<value>', 'name' : 'real'
119 | 2 | 'highway' : 'motorway', 'name' : 'To Hell'
120 When loading osm data
121 Then table place has no entry for N1
136 | highway | turning_circle
137 | highway | traffic_signals
138 | highway | mini_roundabout
152 | waterway | riverbank
155 Scenario: Boundary with place tag
164 | 2 | 'boundary' : 'administrative', 'place' : 'city' | 200 201 202 203 200
165 | 20 | 'place' : 'city' | 200 201 202 203 200
166 | 40 | 'place' : 'city', 'boundary' : 'statistical' | 200 201 202 203 200
167 When loading osm data
168 Then table place contains
169 | object | class | type | extratags
170 | W2 | boundary | administrative | 'place' : 'city'
171 | W20 | place | city |
172 | W40:boundary | boundary | statistical |
173 | W40:place | place | city |
174 And table place has no entry for W2:place
176 Scenario Outline: Tags that describe a house
179 | 100 | '<key>' : '<value>'
180 | 999 | 'amenity' : 'prison', '<key>' : '<value>'
181 When loading osm data
182 Then table place contains
183 | object | class | type
184 | N100 | place | house
185 | N999 | amenity | prison
186 And table place has no entry for N100:<key>
187 And table place has no entry for N999:<key>
188 And table place has no entry for N999:place
192 | addr:housename | My Mansion
193 | addr:housenumber | 456
194 | addr:conscriptionnumber | 4
195 | addr:streetnumber | 4568765
197 Scenario: Only named with no other interesting tag
200 | 1 | 'landuse' : 'meadow'
201 | 2 | 'landuse' : 'residential', 'name' : 'important'
202 | 3 | 'landuse' : 'residential', 'name' : 'important', 'place' : 'hamlet'
203 When loading osm data
204 Then table place contains
205 | object | class | type
206 | N2 | landuse | residential
207 | N3 | place | hamlet
208 And table place has no entry for N1
209 And table place has no entry for N3:landuse
211 Scenario Outline: Import of postal codes
214 | 10 | 'highway' : 'secondary', '<key>' : '<value>'
215 | 11 | '<key>' : '<value>'
216 When loading osm data
217 Then table place contains
218 | object | class | type | postcode
219 | N10 | highway | secondary | <value>
220 | N11 | place | postcode | <value>
221 And table place has no entry for N10:place
225 | postal_code | 45736
226 | post_code | gf4 65g
228 | addr:postcode | 564
229 | tiger:zip_left | 00011
230 | tiger:zip_right | 09123
232 Scenario: Import of street and place
235 | 10 | 'amenity' : 'hospital', 'addr:street' : 'Foo St'
236 | 20 | 'amenity' : 'hospital', 'addr:place' : 'Foo Town'
237 When loading osm data
238 Then table place contains
239 | object | class | type | street | addr_place
240 | N10 | amenity | hospital | Foo St | None
241 | N20 | amenity | hospital | None | Foo Town
244 Scenario Outline: Import of country
247 | 10 | 'place' : 'village', '<key>' : '<value>'
248 When loading osm data
249 Then table place contains
250 | object | class | type | country_code
251 | N10 | place | village | <value>
255 | country_code_iso3166_1_alpha_2 | gb
256 | country_code_iso3166_1 | UK
257 | country_code_iso3166 | de
259 | iso3166-1:alpha2 | aU
263 | is_in:country_code | __
265 | addr:country_code | cv
267 Scenario Outline: Ignore country codes with wrong length
270 | 10 | 'place' : 'village', 'country_code' : '<value>'
271 When loading osm data
272 Then table place contains
273 | object | class | type | country_code
274 | N10 | place | village | None
284 Scenario: Import of house numbers
287 | 10 | 'building' : 'yes', 'addr:housenumber' : '4b'
288 | 11 | 'building' : 'yes', 'addr:conscriptionnumber' : '003'
289 | 12 | 'building' : 'yes', 'addr:streetnumber' : '2345'
290 | 13 | 'building' : 'yes', 'addr:conscriptionnumber' : '3', 'addr:streetnumber' : '111'
291 When loading osm data
292 Then table place contains
293 | object | class | type | housenumber
294 | N10 | place | house | 4b
295 | N11 | place | house | 003
296 | N12 | place | house | 2345
297 | N13 | place | house | 3/111
299 Scenario: Import of address interpolations
302 | 10 | 'addr:interpolation' : 'odd'
303 | 11 | 'addr:housenumber' : '10', 'addr:interpolation' : 'odd'
304 | 12 | 'addr:interpolation' : 'odd', 'addr:housenumber' : '23'
305 When loading osm data
306 Then table place contains
307 | object | class | type | housenumber
308 | N10 | place | houses | odd
309 | N11 | place | houses | odd
310 | N12 | place | houses | odd
312 Scenario: Shorten tiger:county tags
315 | 10 | 'place' : 'village', 'tiger:county' : 'Feebourgh, AL'
316 | 11 | 'place' : 'village', 'addr:state' : 'Alabama', 'tiger:county' : 'Feebourgh, AL'
317 When loading osm data
318 Then table place contains
319 | object | class | type | isin
320 | N10 | place | village | Feebourgh county
321 | N11 | place | village | Alabama,Feebourgh county
323 Scenario Outline: Import of address tags
326 | 10 | 'place' : 'village', '<key>' : '<value>'
327 When loading osm data
328 Then table place contains
329 | object | class | type | isin
330 | N10 | place | village | <value>
334 | is_in | Stockholm, Sweden
335 | is_in:country | Xanadu
336 | addr:suburb | hinein
337 | addr:county | le havre
341 Scenario: Import of admin level
344 | 10 | 'amenity' : 'hospital', 'admin_level' : '3'
345 | 11 | 'amenity' : 'hospital', 'admin_level' : 'b'
346 When loading osm data
347 Then table place contains
348 | object | class | type | admin_level
349 | N10 | amenity | hospital | 3
350 | N11 | amenity | hospital | 0
352 Scenario: Import of extra tags
355 | 10 | 'tourism' : 'hotel', '<key>' : 'foo'
356 When loading osm data
357 Then table place contains
358 | object | class | type | extratags
359 | N10 | tourism | hotel | '<key>' : 'foo'
439 | 10 | 'tourism' : 'hotel', 'building' : 'yes'
440 | 11 | 'building' : 'house'
441 | 12 | 'building' : 'shed', 'addr:housenumber' : '1'
442 | 13 | 'building' : 'yes', 'name' : 'Das Haus'
443 | 14 | 'building' : 'yes', 'addr:postcode' : '12345'
444 When loading osm data
445 Then table place contains
446 | object | class | type
447 | N10 | tourism | hotel
448 | N12 | place | house
449 | N13 | building| yes
450 | N14 | building| yes
451 And table place has no entry for N10:building
452 And table place has no entry for N11