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
208 | highway | bridleway
211 | highway | motorway_link
212 | highway | primary_link
213 | highway | trunk_link
214 | highway | secondary_link
215 | highway | tertiary_link
217 | boundary | administrative
220 Scenario: named junctions are included if there is no other tag
223 | 1 | 'junction' : 'yes'
224 | 2 | 'highway' : 'secondary', 'junction' : 'roundabout', 'name' : 'To Hell'
225 | 3 | 'junction' : 'yes', 'name' : 'Le Croix'
226 When loading osm data
227 Then table place has no entry for N1
228 And table place has no entry for N2:junction
229 And table place contains
230 | object | class | type
231 | N3 | junction | yes
233 Scenario: Boundary with place tag
242 | 2 | 'boundary' : 'administrative', 'place' : 'city', 'name' : 'Foo' | 200 201 202 203 200
243 | 4 | 'boundary' : 'administrative', 'place' : 'island','name' : 'Foo' | 200 201 202 203 200
244 | 20 | 'place' : 'city', 'name' : 'ngng' | 200 201 202 203 200
245 | 40 | 'place' : 'city', 'boundary' : 'statistical', 'name' : 'BB' | 200 201 202 203 200
246 When loading osm data
247 Then table place contains
248 | object | class | extratags | type
249 | W2 | boundary | 'place' : 'city' | administrative
250 | W4:boundary | boundary | None | administrative
251 | W4:place | place | None | island
252 | W20 | place | None | city
253 | W40:boundary | boundary | None | statistical
254 | W40:place | place | None | city
255 And table place has no entry for W2:place
257 Scenario Outline: Tags that describe a house
260 | 100 | '<key>' : '<value>'
261 | 999 | 'amenity' : 'prison', '<key>' : '<value>'
262 When loading osm data
263 Then table place contains
264 | object | class | type
265 | N100 | place | house
266 | N999 | amenity | prison
267 And table place has no entry for N100:<key>
268 And table place has no entry for N999:<key>
269 And table place has no entry for N999:place
273 | addr:housename | My Mansion
274 | addr:housenumber | 456
275 | addr:conscriptionnumber | 4
276 | addr:streetnumber | 4568765
278 Scenario: Only named with no other interesting tag
281 | 1 | 'landuse' : 'meadow'
282 | 2 | 'landuse' : 'residential', 'name' : 'important'
283 | 3 | 'landuse' : 'residential', 'name' : 'important', 'place' : 'hamlet'
284 When loading osm data
285 Then table place contains
286 | object | class | type
287 | N2 | landuse | residential
288 | N3 | place | hamlet
289 And table place has no entry for N1
290 And table place has no entry for N3:landuse
292 Scenario Outline: Import of postal codes
295 | 10 | 'highway' : 'secondary', '<key>' : '<value>'
296 | 11 | '<key>' : '<value>'
297 When loading osm data
298 Then table place contains
299 | object | class | type | postcode
300 | N10 | highway | secondary | <value>
301 | N11 | place | postcode | <value>
302 And table place has no entry for N10:place
306 | postal_code | 45736
308 | addr:postcode | 564
309 | tiger:zip_left | 00011
310 | tiger:zip_right | 09123
312 Scenario: Import of street and place
315 | 10 | 'amenity' : 'hospital', 'addr:street' : 'Foo St'
316 | 20 | 'amenity' : 'hospital', 'addr:place' : 'Foo Town'
317 When loading osm data
318 Then table place contains
319 | object | class | type | street | addr_place
320 | N10 | amenity | hospital | Foo St | None
321 | N20 | amenity | hospital | None | Foo Town
324 Scenario Outline: Import of country
327 | 10 | 'place' : 'village', '<key>' : '<value>'
328 When loading osm data
329 Then table place contains
330 | object | class | type | country_code
331 | N10 | place | village | <value>
337 | is_in:country_code | __
339 | addr:country_code | cv
341 Scenario Outline: Ignore country codes with wrong length
344 | 10 | 'place' : 'village', 'country_code' : '<value>'
345 When loading osm data
346 Then table place contains
347 | object | class | type | country_code
348 | N10 | place | village | None
358 Scenario: Import of house numbers
361 | 10 | 'building' : 'yes', 'addr:housenumber' : '4b'
362 | 11 | 'building' : 'yes', 'addr:conscriptionnumber' : '003'
363 | 12 | 'building' : 'yes', 'addr:streetnumber' : '2345'
364 | 13 | 'building' : 'yes', 'addr:conscriptionnumber' : '3', 'addr:streetnumber' : '111'
365 When loading osm data
366 Then table place contains
367 | object | class | type | housenumber
368 | N10 | building | yes | 4b
369 | N11 | building | yes | 003
370 | N12 | building | yes | 2345
371 | N13 | building | yes | 3/111
373 Scenario: Import of address interpolations
376 | 10 | 'addr:interpolation' : 'odd'
377 | 11 | 'addr:housenumber' : '10', 'addr:interpolation' : 'odd'
378 | 12 | 'addr:interpolation' : 'odd', 'addr:housenumber' : '23'
379 When loading osm data
380 Then table place contains
381 | object | class | type | housenumber
382 | N10 | place | houses | odd
383 | N11 | place | houses | odd
384 | N12 | place | houses | odd
386 Scenario: Shorten tiger:county tags
389 | 10 | 'place' : 'village', 'tiger:county' : 'Feebourgh, AL'
390 | 11 | 'place' : 'village', 'addr:state' : 'Alabama', 'tiger:county' : 'Feebourgh, AL'
391 | 12 | 'place' : 'village', 'tiger:county' : 'Feebourgh'
392 When loading osm data
393 Then table place contains
394 | object | class | type | isin
395 | N10 | place | village | Feebourgh county
396 | N11 | place | village | Alabama,Feebourgh county
397 | N12 | place | village | Feebourgh county
399 Scenario Outline: Import of address tags
402 | 10 | 'place' : 'village', '<key>' : '<value>'
403 When loading osm data
404 Then table place contains
405 | object | class | type | isin
406 | N10 | place | village | <value>
410 | is_in | Stockholm, Sweden
411 | is_in:country | Xanadu
412 | addr:suburb | hinein
413 | addr:county | le havre
417 Scenario: Import of admin level
420 | 10 | 'amenity' : 'hospital', 'admin_level' : '3'
421 | 11 | 'amenity' : 'hospital', 'admin_level' : 'b'
422 | 12 | 'amenity' : 'hospital'
423 | 13 | 'amenity' : 'hospital', 'admin_level' : '3.0'
424 When loading osm data
425 Then table place contains
426 | object | class | type | admin_level
427 | N10 | amenity | hospital | 3
428 | N11 | amenity | hospital | 100
429 | N12 | amenity | hospital | 100
430 | N13 | amenity | hospital | 3
432 Scenario: Import of extra tags
435 | 10 | 'tourism' : 'hotel', '<key>' : 'foo'
436 When loading osm data
437 Then table place contains
438 | object | class | type | extratags
439 | N10 | tourism | hotel | '<key>' : 'foo'
515 | 10 | 'tourism' : 'hotel', 'building' : 'yes'
516 | 11 | 'building' : 'house'
517 | 12 | 'building' : 'shed', 'addr:housenumber' : '1'
518 | 13 | 'building' : 'yes', 'name' : 'Das Haus'
519 | 14 | 'building' : 'yes', 'addr:postcode' : '12345'
520 When loading osm data
521 Then table place contains
522 | object | class | type
523 | N10 | tourism | hotel
524 | N12 | building| yes
525 | N13 | building| yes
526 | N14 | building| yes
527 And table place has no entry for N10:building
528 And table place has no entry for N11
530 Scenario: complete node entry
533 | 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'
534 When loading osm data
535 Then table place contains
536 | object | class | type | housenumber
537 | N290393920 | place | house| 43\