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'
84 Scenario: Special character in name tag
87 | 1 | 'highway' : 'yes', 'name: de' : 'Foo', 'name' : 'real1'
88 | 2 | 'highway' : 'yes', 'name:
de' : 'Foo', 'name' : 'real2'
89 | 3 | 'highway' : 'yes', 'name:	de' : 'Foo', 'name:\\' : 'real3'
91 Then table place contains
93 | N1 | 'name: de' : 'Foo', 'name' : 'real1'
94 | N2 | 'name: de' : 'Foo', 'name' : 'real2'
95 | N3 | 'name: de' : 'Foo', 'name:\\\\' : 'real3'
97 Scenario Outline: Included places
100 | 1 | '<key>' : '<value>', 'name' : 'real'
101 When loading osm data
102 Then table place contains
104 | N1 | 'name' : 'real'
109 | tourism | information
111 | military | barracks
113 | highway | residential
114 | aerialway | station
116 | boundary | administrative
118 | leisure | playground
125 | mountain_pass | yes
127 Scenario Outline: Bridges and Tunnels take special name tags
130 | 1 | 'highway' : 'road', '<key>' : 'yes', 'name' : 'Rd', '<key>:name' : 'My'
131 | 2 | 'highway' : 'road', '<key>' : 'yes', 'name' : 'Rd'
132 When loading osm data
133 Then table place contains
134 | object | class | type | name
135 | N1:highway | highway | road | 'name' : 'Rd'
136 | N1:<key> | <key> | yes | 'name' : 'My'
137 | N2:highway | highway | road | 'name' : 'Rd'
138 And table place has no entry for N2:<key>
145 Scenario Outline: Excluded places
148 | 1 | '<key>' : '<value>', 'name' : 'real'
149 | 2 | 'highway' : 'motorway', 'name' : 'To Hell'
150 When loading osm data
151 Then table place has no entry for N1
166 | highway | turning_circle
167 | highway | mini_roundabout
172 | man_made | survey_point
181 | railway | level_crossing
184 | waterway | riverbank
186 Scenario: Some tags only are included when named
189 | 1 | '<key>' : '<value>'
190 | 2 | '<key>' : '<value>', 'name' : 'To Hell'
191 | 3 | '<key>' : '<value>', 'ref' : '123'
192 When loading osm data
193 Then table place has no entry for N1
194 And table place has no entry for N3
195 And table place contains
196 | object | class | type
197 | N2 | <key> | <value>
201 | landuse | residential
203 | highway | traffic_signals
209 | highway | bridleway
212 | highway | motorway_link
213 | highway | primary_link
214 | highway | trunk_link
215 | highway | secondary_link
216 | highway | tertiary_link
218 | boundary | administrative
221 Scenario: Footways are not included if they are sidewalks
224 | 2 | 'highway' : 'footway', 'name' : 'To Hell', 'footway' : 'sidewalk'
225 | 23 | 'highway' : 'footway', 'name' : 'x'
226 When loading osm data
227 Then table place has no entry for N2
229 Scenario: named junctions are included if there is no other tag
232 | 1 | 'junction' : 'yes'
233 | 2 | 'highway' : 'secondary', 'junction' : 'roundabout', 'name' : 'To Hell'
234 | 3 | 'junction' : 'yes', 'name' : 'Le Croix'
235 When loading osm data
236 Then table place has no entry for N1
237 And table place has no entry for N2:junction
238 And table place contains
239 | object | class | type
240 | N3 | junction | yes
242 Scenario: Boundary with place tag
251 | 2 | 'boundary' : 'administrative', 'place' : 'city', 'name' : 'Foo' | 200 201 202 203 200
252 | 4 | 'boundary' : 'administrative', 'place' : 'island','name' : 'Foo' | 200 201 202 203 200
253 | 20 | 'place' : 'city', 'name' : 'ngng' | 200 201 202 203 200
254 | 40 | 'place' : 'city', 'boundary' : 'statistical', 'name' : 'BB' | 200 201 202 203 200
255 When loading osm data
256 Then table place contains
257 | object | class | extratags | type
258 | W2 | boundary | 'place' : 'city' | administrative
259 | W4:boundary | boundary | None | administrative
260 | W4:place | place | None | island
261 | W20 | place | None | city
262 | W40:boundary | boundary | None | statistical
263 | W40:place | place | None | city
264 And table place has no entry for W2:place
266 Scenario Outline: Tags that describe a house
269 | 100 | '<key>' : '<value>'
270 | 999 | 'amenity' : 'prison', '<key>' : '<value>'
271 When loading osm data
272 Then table place contains
273 | object | class | type
274 | N100 | place | house
275 | N999 | amenity | prison
276 And table place has no entry for N100:<key>
277 And table place has no entry for N999:<key>
278 And table place has no entry for N999:place
282 | addr:housename | My Mansion
283 | addr:housenumber | 456
284 | addr:conscriptionnumber | 4
285 | addr:streetnumber | 4568765
287 Scenario: Only named with no other interesting tag
290 | 1 | 'landuse' : 'meadow'
291 | 2 | 'landuse' : 'residential', 'name' : 'important'
292 | 3 | 'landuse' : 'residential', 'name' : 'important', 'place' : 'hamlet'
293 When loading osm data
294 Then table place contains
295 | object | class | type
296 | N2 | landuse | residential
297 | N3 | place | hamlet
298 And table place has no entry for N1
299 And table place has no entry for N3:landuse
301 Scenario Outline: Import of postal codes
304 | 10 | 'highway' : 'secondary', '<key>' : '<value>'
305 | 11 | '<key>' : '<value>'
306 When loading osm data
307 Then table place contains
308 | object | class | type | postcode
309 | N10 | highway | secondary | <value>
310 | N11 | place | postcode | <value>
311 And table place has no entry for N10:place
315 | postal_code | 45736
317 | addr:postcode | 564
318 | tiger:zip_left | 00011
319 | tiger:zip_right | 09123
321 Scenario: Import of street and place
324 | 10 | 'amenity' : 'hospital', 'addr:street' : 'Foo St'
325 | 20 | 'amenity' : 'hospital', 'addr:place' : 'Foo Town'
326 When loading osm data
327 Then table place contains
328 | object | class | type | street | addr_place
329 | N10 | amenity | hospital | Foo St | None
330 | N20 | amenity | hospital | None | Foo Town
333 Scenario Outline: Import of country
336 | 10 | 'place' : 'village', '<key>' : '<value>'
337 When loading osm data
338 Then table place contains
339 | object | class | type | country_code
340 | N10 | place | village | <value>
346 | is_in:country_code | __
348 | addr:country_code | cv
350 Scenario Outline: Ignore country codes with wrong length
353 | 10 | 'place' : 'village', 'country_code' : '<value>'
354 When loading osm data
355 Then table place contains
356 | object | class | type | country_code
357 | N10 | place | village | None
367 Scenario: Import of house numbers
370 | 10 | 'building' : 'yes', 'addr:housenumber' : '4b'
371 | 11 | 'building' : 'yes', 'addr:conscriptionnumber' : '003'
372 | 12 | 'building' : 'yes', 'addr:streetnumber' : '2345'
373 | 13 | 'building' : 'yes', 'addr:conscriptionnumber' : '3', 'addr:streetnumber' : '111'
374 When loading osm data
375 Then table place contains
376 | object | class | type | housenumber
377 | N10 | building | yes | 4b
378 | N11 | building | yes | 003
379 | N12 | building | yes | 2345
380 | N13 | building | yes | 3/111
382 Scenario: Import of address interpolations
385 | 10 | 'addr:interpolation' : 'odd'
386 | 11 | 'addr:housenumber' : '10', 'addr:interpolation' : 'odd'
387 | 12 | 'addr:interpolation' : 'odd', 'addr:housenumber' : '23'
388 When loading osm data
389 Then table place contains
390 | object | class | type | housenumber
391 | N10 | place | houses | odd
392 | N11 | place | houses | odd
393 | N12 | place | houses | odd
395 Scenario: Shorten tiger:county tags
398 | 10 | 'place' : 'village', 'tiger:county' : 'Feebourgh, AL'
399 | 11 | 'place' : 'village', 'addr:state' : 'Alabama', 'tiger:county' : 'Feebourgh, AL'
400 | 12 | 'place' : 'village', 'tiger:county' : 'Feebourgh'
401 When loading osm data
402 Then table place contains
403 | object | class | type | isin
404 | N10 | place | village | Feebourgh county
405 | N11 | place | village | Feebourgh county,Alabama
406 | N12 | place | village | Feebourgh county
408 Scenario Outline: Import of address tags
411 | 10 | 'place' : 'village', '<key>' : '<value>'
412 When loading osm data
413 Then table place contains
414 | object | class | type | isin
415 | N10 | place | village | <value>
419 | is_in | Stockholm, Sweden
420 | is_in:country | Xanadu
421 | addr:suburb | hinein
422 | addr:county | le havre
426 Scenario: Import of admin level
429 | 10 | 'amenity' : 'hospital', 'admin_level' : '3'
430 | 11 | 'amenity' : 'hospital', 'admin_level' : 'b'
431 | 12 | 'amenity' : 'hospital'
432 | 13 | 'amenity' : 'hospital', 'admin_level' : '3.0'
433 When loading osm data
434 Then table place contains
435 | object | class | type | admin_level
436 | N10 | amenity | hospital | 3
437 | N11 | amenity | hospital | 100
438 | N12 | amenity | hospital | 100
439 | N13 | amenity | hospital | 3
441 Scenario: Import of extra tags
444 | 10 | 'tourism' : 'hotel', '<key>' : 'foo'
445 When loading osm data
446 Then table place contains
447 | object | class | type | extratags
448 | N10 | tourism | hotel | '<key>' : 'foo'
523 | name:etymology:wikidata
528 | 10 | 'tourism' : 'hotel', 'building' : 'yes'
529 | 11 | 'building' : 'house'
530 | 12 | 'building' : 'shed', 'addr:housenumber' : '1'
531 | 13 | 'building' : 'yes', 'name' : 'Das Haus'
532 | 14 | 'building' : 'yes', 'addr:postcode' : '12345'
533 When loading osm data
534 Then table place contains
535 | object | class | type
536 | N10 | tourism | hotel
537 | N12 | building| yes
538 | N13 | building| yes
539 | N14 | building| yes
540 And table place has no entry for N10:building
541 And table place has no entry for N11
543 Scenario: complete node entry
546 | 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'
547 When loading osm data
548 Then table place contains
549 | object | class | type | housenumber
550 | N290393920 | place | house| 43\