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'
49 Scenario Outline: operator only for shops and amenities
52 | 1 | 'highway' : 'yes', 'operator' : 'Foo', 'name' : 'null'
53 | 2 | 'shop' : 'grocery', 'operator' : 'Foo'
54 | 3 | 'amenity' : 'hospital', 'operator' : 'Foo'
55 | 4 | 'tourism' : 'hotel', 'operator' : 'Foo'
57 Then table place contains
59 | N1 | 'name' : 'null'
60 | N2 | 'operator' : 'Foo'
61 | N3 | 'operator' : 'Foo'
62 | N4 | 'operator' : 'Foo'
64 Scenario Outline: Ignored name tags
67 | 1 | 'highway' : 'yes', '<nametag>' : 'Foo', 'name' : 'real'
69 Then table place contains
71 | N1 | 'name' : 'real'
83 Scenario: Special character in name tag
86 | 1 | 'highway' : 'yes', 'name: de' : 'Foo', 'name' : 'real'
87 | 2 | 'highway' : 'yes', 'name:\nde' : 'Foo', 'name' : 'real'
88 | 3 | 'highway' : 'yes', 'name:\tde' : 'Foo', 'name:\\' : 'real'
90 Then table place contains
92 | N1 | 'name:_de' : 'Foo', 'name' : 'real'
93 | N2 | 'name:_de' : 'Foo', 'name' : 'real'
94 | N3 | 'name:_de' : 'Foo', 'name:\\\\' : 'real'
96 Scenario Outline: Included places
99 | 1 | '<key>' : '<value>', 'name' : 'real'
100 When loading osm data
101 Then table place contains
103 | N1 | 'name' : 'real'
108 | tourism | information
110 | military | barracks
112 | highway | residential
113 | aerialway | station
115 | boundary | administrative
117 | leisure | playground
124 | mountain_pass | yes
126 Scenario Outline: Bridges and Tunnels take special name tags
129 | 1 | 'highway' : 'road', '<key>' : 'yes', 'name' : 'Rd', '<key>:name' : 'My'
130 | 2 | 'highway' : 'road', '<key>' : 'yes', 'name' : 'Rd'
131 When loading osm data
132 Then table place contains
133 | object | class | type | name
134 | N1:highway | highway | road | 'name' : 'Rd'
135 | N1:<key> | <key> | yes | 'name' : 'My'
136 | N2:highway | highway | road | 'name' : 'Rd'
137 And table place has no entry for N2:<key>
144 Scenario Outline: Excluded places
147 | 1 | '<key>' : '<value>', 'name' : 'real'
148 | 2 | 'highway' : 'motorway', 'name' : 'To Hell'
149 When loading osm data
150 Then table place has no entry for N1
165 | highway | turning_circle
166 | highway | mini_roundabout
171 | man_made | survey_point
180 | railway | level_crossing
183 | waterway | riverbank
185 Scenario: Some tags only are included when named
188 | 1 | '<key>' : '<value>'
189 | 2 | '<key>' : '<value>', 'name' : 'To Hell'
190 | 3 | '<key>' : '<value>', 'ref' : '123'
191 When loading osm data
192 Then table place has no entry for N1
193 And table place has no entry for N3
194 And table place contains
195 | object | class | type
196 | N2 | <key> | <value>
200 | landuse | residential
202 | highway | traffic_signals
206 | highway | motorway_link
207 | highway | tertiary_link
209 | boundary | administrative
212 Scenario: named junctions are included if there is no other tag
215 | 1 | 'junction' : 'yes'
216 | 2 | 'highway' : 'secondary', 'junction' : 'roundabout', 'name' : 'To Hell'
217 | 3 | 'junction' : 'yes', 'name' : 'Le Croix'
218 When loading osm data
219 Then table place has no entry for N1
220 And table place has no entry for N2:junction
221 And table place contains
222 | object | class | type
223 | N3 | junction | yes
225 Scenario: Boundary with place tag
234 | 2 | 'boundary' : 'administrative', 'place' : 'city', 'name' : 'Foo' | 200 201 202 203 200
235 | 4 | 'boundary' : 'administrative', 'place' : 'island','name' : 'Foo' | 200 201 202 203 200
236 | 20 | 'place' : 'city', 'name' : 'ngng' | 200 201 202 203 200
237 | 40 | 'place' : 'city', 'boundary' : 'statistical', 'name' : 'BB' | 200 201 202 203 200
238 When loading osm data
239 Then table place contains
240 | object | class | type | extratags
241 | W2 | boundary | administrative | 'place' : 'city'
242 | W4:boundary | boundary | administrative |
243 | W4:place | place | island |
244 | W20 | place | city |
245 | W40:boundary | boundary | statistical |
246 | W40:place | place | city |
247 And table place has no entry for W2:place
249 Scenario Outline: Tags that describe a house
252 | 100 | '<key>' : '<value>'
253 | 999 | 'amenity' : 'prison', '<key>' : '<value>'
254 When loading osm data
255 Then table place contains
256 | object | class | type
257 | N100 | place | house
258 | N999 | amenity | prison
259 And table place has no entry for N100:<key>
260 And table place has no entry for N999:<key>
261 And table place has no entry for N999:place
265 | addr:housename | My Mansion
266 | addr:housenumber | 456
267 | addr:conscriptionnumber | 4
268 | addr:streetnumber | 4568765
270 Scenario: Only named with no other interesting tag
273 | 1 | 'landuse' : 'meadow'
274 | 2 | 'landuse' : 'residential', 'name' : 'important'
275 | 3 | 'landuse' : 'residential', 'name' : 'important', 'place' : 'hamlet'
276 When loading osm data
277 Then table place contains
278 | object | class | type
279 | N2 | landuse | residential
280 | N3 | place | hamlet
281 And table place has no entry for N1
282 And table place has no entry for N3:landuse
284 Scenario Outline: Import of postal codes
287 | 10 | 'highway' : 'secondary', '<key>' : '<value>'
288 | 11 | '<key>' : '<value>'
289 When loading osm data
290 Then table place contains
291 | object | class | type | postcode
292 | N10 | highway | secondary | <value>
293 | N11 | place | postcode | <value>
294 And table place has no entry for N10:place
298 | postal_code | 45736
300 | addr:postcode | 564
301 | tiger:zip_left | 00011
302 | tiger:zip_right | 09123
304 Scenario: Import of street and place
307 | 10 | 'amenity' : 'hospital', 'addr:street' : 'Foo St'
308 | 20 | 'amenity' : 'hospital', 'addr:place' : 'Foo Town'
309 When loading osm data
310 Then table place contains
311 | object | class | type | street | addr_place
312 | N10 | amenity | hospital | Foo St | None
313 | N20 | amenity | hospital | None | Foo Town
316 Scenario Outline: Import of country
319 | 10 | 'place' : 'village', '<key>' : '<value>'
320 When loading osm data
321 Then table place contains
322 | object | class | type | country_code
323 | N10 | place | village | <value>
329 | is_in:country_code | __
331 | addr:country_code | cv
333 Scenario Outline: Ignore country codes with wrong length
336 | 10 | 'place' : 'village', 'country_code' : '<value>'
337 When loading osm data
338 Then table place contains
339 | object | class | type | country_code
340 | N10 | place | village | None
350 Scenario: Import of house numbers
353 | 10 | 'building' : 'yes', 'addr:housenumber' : '4b'
354 | 11 | 'building' : 'yes', 'addr:conscriptionnumber' : '003'
355 | 12 | 'building' : 'yes', 'addr:streetnumber' : '2345'
356 | 13 | 'building' : 'yes', 'addr:conscriptionnumber' : '3', 'addr:streetnumber' : '111'
357 When loading osm data
358 Then table place contains
359 | object | class | type | housenumber
360 | N10 | building | yes | 4b
361 | N11 | building | yes | 003
362 | N12 | building | yes | 2345
363 | N13 | building | yes | 3/111
365 Scenario: Import of address interpolations
368 | 10 | 'addr:interpolation' : 'odd'
369 | 11 | 'addr:housenumber' : '10', 'addr:interpolation' : 'odd'
370 | 12 | 'addr:interpolation' : 'odd', 'addr:housenumber' : '23'
371 When loading osm data
372 Then table place contains
373 | object | class | type | housenumber
374 | N10 | place | houses | odd
375 | N11 | place | houses | odd
376 | N12 | place | houses | odd
378 Scenario: Shorten tiger:county tags
381 | 10 | 'place' : 'village', 'tiger:county' : 'Feebourgh, AL'
382 | 11 | 'place' : 'village', 'addr:state' : 'Alabama', 'tiger:county' : 'Feebourgh, AL'
383 | 12 | 'place' : 'village', 'tiger:county' : 'Feebourgh'
384 When loading osm data
385 Then table place contains
386 | object | class | type | isin
387 | N10 | place | village | Feebourgh county
388 | N11 | place | village | Alabama,Feebourgh county
389 | N12 | place | village | Feebourgh county
391 Scenario Outline: Import of address tags
394 | 10 | 'place' : 'village', '<key>' : '<value>'
395 When loading osm data
396 Then table place contains
397 | object | class | type | isin
398 | N10 | place | village | <value>
402 | is_in | Stockholm, Sweden
403 | is_in:country | Xanadu
404 | addr:suburb | hinein
405 | addr:county | le havre
409 Scenario: Import of admin level
412 | 10 | 'amenity' : 'hospital', 'admin_level' : '3'
413 | 11 | 'amenity' : 'hospital', 'admin_level' : 'b'
414 | 12 | 'amenity' : 'hospital'
415 | 13 | 'amenity' : 'hospital', 'admin_level' : '3.0'
416 When loading osm data
417 Then table place contains
418 | object | class | type | admin_level
419 | N10 | amenity | hospital | 3
420 | N11 | amenity | hospital | 100
421 | N12 | amenity | hospital | 100
422 | N13 | amenity | hospital | 3
424 Scenario: Import of extra tags
427 | 10 | 'tourism' : 'hotel', '<key>' : 'foo'
428 When loading osm data
429 Then table place contains
430 | object | class | type | extratags
431 | N10 | tourism | hotel | '<key>' : 'foo'
507 | 10 | 'tourism' : 'hotel', 'building' : 'yes'
508 | 11 | 'building' : 'house'
509 | 12 | 'building' : 'shed', 'addr:housenumber' : '1'
510 | 13 | 'building' : 'yes', 'name' : 'Das Haus'
511 | 14 | 'building' : 'yes', 'addr:postcode' : '12345'
512 When loading osm data
513 Then table place contains
514 | object | class | type
515 | N10 | tourism | hotel
516 | N12 | building| yes
517 | N13 | building| yes
518 | N14 | building| yes
519 And table place has no entry for N10:building
520 And table place has no entry for N11
522 Scenario: complete node entry
525 | 290393920 | 'addr:city':'Perpignan','addr:country':'FR','addr:housenumber':'43\\','addr:postcode':'66000','addr:street':'Rue Pierre Constant d`Ivry','source':'cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre ; mise à jour :2008'
526 When loading osm data
527 Then table place contains
528 | object | class | type | housenumber
529 | N290393920 | place | house| 43\