2 Feature: Tag evaluation
3 Tests if tags are correctly imported into the place table
5 Scenario Outline: Name tags
8 n1 Thighway=yes,<nametag>=Foo
12 | N1 | '<nametag>' : 'Foo' |
49 Scenario: operator only for shops and amenities
52 n1 Thighway=yes,operator=Foo,name=null
53 n2 Tshop=grocery,operator=Foo
54 n3 Tamenity=hospital,operator=Foo
55 n4 Ttourism=hotel,operator=Foo
59 | N1 | 'name' : 'null' |
60 | N2 | 'operator' : 'Foo' |
61 | N3 | 'operator' : 'Foo' |
62 | N4 | 'operator' : 'Foo' |
64 Scenario Outline: Ignored name tags
67 n1 Thighway=yes,<nametag>=Foo,name=real
71 | N1 | 'name' : 'real' |
84 Scenario: Special character in name tag
87 n1 Thighway=yes,name:%20%de=Foo,name=real1
88 n2 Thighway=yes,name:%a%de=Foo,name=real2
89 n3 Thighway=yes,name:%9%de=Foo,name:\\=real3
90 n4 Thighway=yes,name:%9%de=Foo,name=rea\l3
94 | N1 | 'name: de' : 'Foo', 'name' : 'real1' |
95 | N2 | 'name: de' : 'Foo', 'name' : 'real2' |
96 | N3 | 'name: de' : 'Foo', 'name:\\\\' : 'real3' |
97 | N4 | 'name: de' : 'Foo', 'name' : 'rea\\l3' |
99 Scenario: Unprintable character in address tag are maintained
100 When loading osm data
102 n23 Tamenity=yes,name=foo,addr:postcode=1234%200e%
106 | N23 | 'postcode' : u'1234\u200e' |
108 Scenario Outline: Included places
109 When loading osm data
111 n1 T<key>=<value>,name=real
114 | object | class | type | name |
115 | N1 | <key> | <value> | 'name' : 'real' |
119 | emergency | phone |
120 | tourism | information |
121 | historic | castle |
122 | military | barracks |
124 | highway | residential |
125 | aerialway | station |
127 | boundary | administrative |
129 | leisure | playground |
130 | office | bookmaker |
133 | waterway | stream |
134 | landuse | cemetry |
136 | mountain_pass | yes |
138 Scenario Outline: Bridges and Tunnels take special name tags
139 When loading osm data
141 n1 Thighway=road,<key>=yes,name=Rd,<key>:name=My
142 n2 Thighway=road,<key>=yes,name=Rd
145 | object | type | name |
146 | N1:highway | road | 'name' : 'Rd' |
147 | N1:<key> | yes | 'name' : 'My' |
148 | N2:highway | road | 'name' : 'Rd' |
149 And place has no entry for N2:<key>
156 Scenario Outline: Excluded places
157 When loading osm data
159 n1 T<key>=<value>,name=real
160 n2 Thighway=motorway,name=To%20%Hell
162 Then place has no entry for N1
177 | highway | turning_circle |
178 | highway | mini_roundabout |
180 | highway | crossing |
182 | aerialway | pylon |
183 | man_made | survey_point |
184 | man_made | cutline |
192 | railway | level_crossing |
195 | waterway | riverbank |
197 Scenario Outline: Some tags only are included when named
198 When loading osm data
201 n2 T<key>=<value>,name=To%20%Hell
202 n3 T<key>=<value>,ref=123
204 Then place contains exactly
205 | object | class | type |
206 | N2 | <key> | <value> |
210 | landuse | residential |
212 | highway | traffic_signals |
213 | highway | service |
214 | highway | cycleway |
216 | highway | footway |
218 | highway | bridleway |
221 | highway | motorway_link |
222 | highway | primary_link |
223 | highway | trunk_link |
224 | highway | secondary_link |
225 | highway | tertiary_link |
227 | boundary | administrative |
228 | waterway | stream |
230 Scenario: Footways are not included if they are sidewalks
231 When loading osm data
233 n2 Thighway=footway,name=To%20%Hell,footway=sidewalk
234 n23 Thighway=footway,name=x
236 Then place has no entry for N2
238 Scenario: named junctions are included if there is no other tag
239 When loading osm data
242 n2 Thighway=secondary,junction=roundabout,name=To-Hell
243 n3 Tjunction=yes,name=Le%20%Croix
245 Then place has no entry for N1
246 And place has no entry for N2:junction
248 | object | class | type |
249 | N3 | junction | yes |
251 Scenario: Boundary with place tag
252 When loading osm data
258 w2 Tboundary=administrative,place=city,name=Foo Nn200,n201,n202,n203,n200
259 w4 Tboundary=administrative,place=island,name=Foo Nn200,n201,n202,n203,n200
260 w20 Tplace=city,name=ngng Nn200,n201,n202,n203,n200
261 w40 Tplace=city,boundary=statistical,name=BB Nn200,n201,n202,n203,n200
264 | object | class | extratags | type |
265 | W2 | boundary | 'place' : 'city' | administrative |
266 | W4:boundary | boundary | - | administrative |
267 | W4:place | place | - | island |
268 | W20 | place | - | city |
269 | W40:boundary | boundary | - | statistical |
270 | W40:place | place | - | city |
271 And place has no entry for W2:place
273 Scenario Outline: Tags that describe a house
274 When loading osm data
277 n999 Tamenity=prison,<key>=<value>
279 Then place contains exactly
280 | object | class | type |
281 | N100 | place | house |
282 | N999 | amenity | prison |
286 | addr:housename | My%20%Mansion |
287 | addr:housenumber | 456 |
288 | addr:conscriptionnumber | 4 |
289 | addr:streetnumber | 4568765 |
291 Scenario: Only named with no other interesting tag
292 When loading osm data
295 n2 Tlanduse=residential,name=important
296 n3 Tlanduse=residential,name=important,place=hamlet
299 | object | class | type |
300 | N2 | landuse | residential |
301 | N3 | place | hamlet |
302 And place has no entry for N1
303 And place has no entry for N3:landuse
305 Scenario Outline: Import of postal codes
306 When loading osm data
308 n10 Thighway=secondary,<key>=<value>
312 | object | class | type | addr+postcode |
313 | N10 | highway | secondary | <value> |
314 | N11 | place | postcode | <value> |
315 And place has no entry for N10:place
319 | postal_code | 45736 |
321 | addr:postcode | 564 |
322 | tiger:zip_left | 00011 |
323 | tiger:zip_right | 09123 |
325 Scenario: Import of street and place
326 When loading osm data
328 n10 Tamenity=hospital,addr:street=Foo%20%St
329 n20 Tamenity=hospital,addr:place=Foo%20%Town
332 | object | class | type | addr+street | addr+place |
333 | N10 | amenity | hospital | Foo St | - |
334 | N20 | amenity | hospital | - | Foo Town |
337 Scenario Outline: Import of country
338 When loading osm data
340 n10 Tplace=village,<key>=<value>
343 | object | class | type | addr+country |
344 | N10 | place | village | <value> |
348 | country_code | us |
350 | is_in:country_code | __ |
351 | addr:country | .. |
352 | addr:country_code | cv |
354 Scenario Outline: Ignore country codes with wrong length
355 When loading osm data
357 n10 Tplace=village,country_code=<value>
360 | object | class | type | addr+country |
361 | N10 | place | village | - |
371 Scenario: Import of house numbers
372 When loading osm data
374 n10 Tbuilding=yes,addr:housenumber=4b
375 n11 Tbuilding=yes,addr:conscriptionnumber=003
376 n12 Tbuilding=yes,addr:streetnumber=2345
377 n13 Tbuilding=yes,addr:conscriptionnumber=3,addr:streetnumber=111
380 | object | class | type | address |
381 | N10 | building | yes | 'housenumber' : '4b' |
382 | N11 | building | yes | 'conscriptionnumber' : '003' |
383 | N12 | building | yes | 'streetnumber' : '2345' |
384 | N13 | building | yes | 'conscriptionnumber' : '3', 'streetnumber' : '111' |
386 Scenario: Shorten tiger:county tags
387 When loading osm data
389 n10 Tplace=village,tiger:county=Feebourgh%2c%%20%AL
390 n11 Tplace=village,addr:state=Alabama,tiger:county=Feebourgh%2c%%20%AL
391 n12 Tplace=village,tiger:county=Feebourgh
394 | object | class | type | addr+tiger:county |
395 | N10 | place | village | Feebourgh county |
396 | N11 | place | village | Feebourgh county |
397 | N12 | place | village | Feebourgh county |
399 Scenario Outline: Import of address tags
400 When loading osm data
402 n10 Tplace=village,addr:<key>=<value>
403 n11 Tplace=village,is_in:<key>=<value>
406 | object | class | type | address |
407 | N10 | place | village | '<key>' : '<value>' |
415 Scenario: Import of isin tags with space
416 When loading osm data
418 n10 Tplace=village,is_in=Stockholm%2c%%20%Sweden
419 n11 Tplace=village,addr:county=le%20%havre
422 | object | class | type | address |
423 | N10 | place | village | 'is_in' : 'Stockholm, Sweden' |
424 | N11 | place | village | 'county' : 'le havre' |
426 Scenario: Import of admin level
427 When loading osm data
429 n10 Tamenity=hospital,admin_level=3
430 n11 Tamenity=hospital,admin_level=b
431 n12 Tamenity=hospital
432 n13 Tamenity=hospital,admin_level=3.0
435 | object | class | type | admin_level |
436 | N10 | amenity | hospital | 3 |
437 | N11 | amenity | hospital | 15 |
438 | N12 | amenity | hospital | 15 |
439 | N13 | amenity | hospital | 3 |
441 Scenario Outline: Import of extra tags
442 When loading osm data
444 n10 Ttourism=hotel,<key>=foo
447 | object | class | type | extratags |
448 | N10 | tourism | hotel | '<key>' : 'foo' |
523 | name:etymology:wikidata |
526 When loading osm data
528 n10 Ttourism=hotel,building=yes
530 n12 Tbuilding=shed,addr:housenumber=1
531 n13 Tbuilding=yes,name=Das-Haus
532 n14 Tbuilding=yes,addr:postcode=12345
535 | object | class | type |
536 | N10 | tourism | hotel |
537 | N12 | building| yes |
538 | N13 | building| yes |
539 | N14 | building| yes |
540 And place has no entry for N10:building
541 And place has no entry for N11
543 Scenario: complete node entry
544 When loading osm data
546 n290393920 Taddr:city=Perpignan,addr:country=FR,addr:housenumber=43\,addr:postcode=66000,addr:street=Rue%20%Pierre%20%Constant%20%d`Ivry,source=cadastre-dgi-fr%20%source%20%:%20%Direction%20%Générale%20%des%20%Impôts%20%-%20%Cadastre%20%;%20%mise%20%à%20%jour%20%:2008
549 | object | class | type | address |
550 | N290393920 | place | house| 'city' : 'Perpignan', 'country' : 'FR', 'housenumber' : '43\\', 'postcode' : '66000', 'street' : 'Rue Pierre Constant d`Ivry' |