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=restaurant,operator=Foo
55 n4 Ttourism=hotel,operator=Foo
56 n5 Tamenity=hospital,operator=Foo,name=Meme
57 n6 Tamenity=fuel,operator=Foo
61 | N1 | 'name' : 'null' |
62 | N2 | 'operator' : 'Foo' |
63 | N3 | 'operator' : 'Foo' |
64 | N4 | 'operator' : 'Foo' |
65 | N5 | 'name' : 'Meme' |
66 | N6 | 'operator' : 'Foo' |
68 Scenario Outline: Ignored name tags
71 n1 Thighway=yes,<nametag>=Foo,name=real
75 | N1 | 'name' : 'real' |
88 Scenario: Special character in name tag
91 n1 Thighway=yes,name:%20%de=Foo,name=real1
92 n2 Thighway=yes,name:%a%de=Foo,name=real2
93 n3 Thighway=yes,name:%9%de=Foo,name:\\=real3
94 n4 Thighway=yes,name:%9%de=Foo,name=rea\l3
98 | N1 | 'name: de' : 'Foo', 'name' : 'real1' |
99 | N2 | 'name: de' : 'Foo', 'name' : 'real2' |
100 | N3 | 'name: de' : 'Foo', 'name:\\\\' : 'real3' |
101 | N4 | 'name: de' : 'Foo', 'name' : 'rea\\l3' |
103 Scenario: Unprintable character in address tag are maintained
104 When loading osm data
106 n23 Tamenity=yes,name=foo,addr:postcode=1234%200e%
110 | N23 | 'postcode' : u'1234\u200e' |
112 Scenario Outline: Included places
113 When loading osm data
115 n1 T<key>=<value>,name=real
118 | object | class | type | name |
119 | N1 | <key> | <value> | 'name' : 'real' |
123 | emergency | phone |
124 | tourism | information |
125 | historic | castle |
126 | military | barracks |
128 | highway | residential |
129 | aerialway | station |
131 | boundary | administrative |
133 | leisure | playground |
134 | office | bookmaker |
137 | waterway | stream |
138 | landuse | cemetry |
140 | mountain_pass | yes |
142 Scenario Outline: Bridges and Tunnels take special name tags
143 When loading osm data
145 n1 Thighway=road,<key>=yes,name=Rd,<key>:name=My
146 n2 Thighway=road,<key>=yes,name=Rd
149 | object | type | name |
150 | N1:highway | road | 'name' : 'Rd' |
151 | N1:<key> | yes | 'name' : 'My' |
152 | N2:highway | road | 'name' : 'Rd' |
153 And place has no entry for N2:<key>
160 Scenario Outline: Excluded places
161 When loading osm data
163 n1 T<key>=<value>,name=real
164 n2 Thighway=motorway,name=To%20%Hell
166 Then place has no entry for N1
181 | highway | turning_circle |
182 | highway | mini_roundabout |
184 | highway | crossing |
186 | aerialway | pylon |
187 | man_made | survey_point |
188 | man_made | cutline |
196 | railway | level_crossing |
199 | waterway | riverbank |
201 Scenario Outline: Some tags only are included when named
202 When loading osm data
205 n2 T<key>=<value>,name=To%20%Hell
206 n3 T<key>=<value>,ref=123
208 Then place contains exactly
209 | object | class | type |
210 | N2 | <key> | <value> |
214 | landuse | residential |
216 | highway | traffic_signals |
217 | highway | service |
218 | highway | cycleway |
220 | highway | footway |
222 | highway | bridleway |
225 | highway | motorway_link |
226 | highway | primary_link |
227 | highway | trunk_link |
228 | highway | secondary_link |
229 | highway | tertiary_link |
231 | boundary | administrative |
232 | waterway | stream |
234 Scenario: Footways are not included if they are sidewalks
235 When loading osm data
237 n2 Thighway=footway,name=To%20%Hell,footway=sidewalk
238 n23 Thighway=footway,name=x
240 Then place has no entry for N2
242 Scenario: named junctions are included if there is no other tag
243 When loading osm data
246 n2 Thighway=secondary,junction=roundabout,name=To-Hell
247 n3 Tjunction=yes,name=Le%20%Croix
249 Then place has no entry for N1
250 And place has no entry for N2:junction
252 | object | class | type |
253 | N3 | junction | yes |
255 Scenario: Boundary with place tag
256 When loading osm data
262 w2 Tboundary=administrative,place=city,name=Foo Nn200,n201,n202,n203,n200
263 w4 Tboundary=administrative,place=island,name=Foo Nn200,n201,n202,n203,n200
264 w20 Tplace=city,name=ngng Nn200,n201,n202,n203,n200
265 w40 Tplace=city,boundary=statistical,name=BB Nn200,n201,n202,n203,n200
268 | object | class | extratags | type |
269 | W2 | boundary | 'place' : 'city' | administrative |
270 | W4:boundary | boundary | - | administrative |
271 | W4:place | place | - | island |
272 | W20 | place | - | city |
273 | W40:boundary | boundary | - | statistical |
274 | W40:place | place | - | city |
275 And place has no entry for W2:place
277 Scenario Outline: Tags that describe a house
278 When loading osm data
281 n999 Tamenity=prison,<key>=<value>
283 Then place contains exactly
284 | object | class | type |
285 | N100 | place | house |
286 | N999 | amenity | prison |
290 | addr:housename | My%20%Mansion |
291 | addr:housenumber | 456 |
292 | addr:conscriptionnumber | 4 |
293 | addr:streetnumber | 4568765 |
295 Scenario: Only named with no other interesting tag
296 When loading osm data
299 n2 Tlanduse=residential,name=important
300 n3 Tlanduse=residential,name=important,place=hamlet
303 | object | class | type |
304 | N2 | landuse | residential |
305 | N3 | place | hamlet |
306 And place has no entry for N1
307 And place has no entry for N3:landuse
309 Scenario Outline: Import of postal codes
310 When loading osm data
312 n10 Thighway=secondary,<key>=<value>
316 | object | class | type | addr+postcode |
317 | N10 | highway | secondary | <value> |
318 | N11 | place | postcode | <value> |
319 And place has no entry for N10:place
323 | postal_code | 45736 |
325 | addr:postcode | 564 |
326 | tiger:zip_left | 00011 |
327 | tiger:zip_right | 09123 |
329 Scenario: Import of street and place
330 When loading osm data
332 n10 Tamenity=hospital,addr:street=Foo%20%St
333 n20 Tamenity=hospital,addr:place=Foo%20%Town
336 | object | class | type | addr+street | addr+place |
337 | N10 | amenity | hospital | Foo St | - |
338 | N20 | amenity | hospital | - | Foo Town |
341 Scenario Outline: Import of country
342 When loading osm data
344 n10 Tplace=village,<key>=<value>
347 | object | class | type | addr+country |
348 | N10 | place | village | <value> |
352 | country_code | us |
354 | is_in:country_code | __ |
355 | addr:country | .. |
356 | addr:country_code | cv |
358 Scenario Outline: Ignore country codes with wrong length
359 When loading osm data
361 n10 Tplace=village,country_code=<value>
364 | object | class | type | addr+country |
365 | N10 | place | village | - |
375 Scenario: Import of house numbers
376 When loading osm data
378 n10 Tbuilding=yes,addr:housenumber=4b
379 n11 Tbuilding=yes,addr:conscriptionnumber=003
380 n12 Tbuilding=yes,addr:streetnumber=2345
381 n13 Tbuilding=yes,addr:conscriptionnumber=3,addr:streetnumber=111
384 | object | class | type | address |
385 | N10 | building | yes | 'housenumber' : '4b' |
386 | N11 | building | yes | 'conscriptionnumber' : '003' |
387 | N12 | building | yes | 'streetnumber' : '2345' |
388 | N13 | building | yes | 'conscriptionnumber' : '3', 'streetnumber' : '111' |
390 Scenario: Shorten tiger:county tags
391 When loading osm data
393 n10 Tplace=village,tiger:county=Feebourgh%2c%%20%AL
394 n11 Tplace=village,addr:state=Alabama,tiger:county=Feebourgh%2c%%20%AL
395 n12 Tplace=village,tiger:county=Feebourgh
398 | object | class | type | addr+tiger:county |
399 | N10 | place | village | Feebourgh county |
400 | N11 | place | village | Feebourgh county |
401 | N12 | place | village | Feebourgh county |
403 Scenario Outline: Import of address tags
404 When loading osm data
406 n10 Tplace=village,addr:<key>=<value>
407 n11 Tplace=village,is_in:<key>=<value>
410 | object | class | type | address |
411 | N10 | place | village | '<key>' : '<value>' |
419 Scenario: Import of isin tags with space
420 When loading osm data
422 n10 Tplace=village,is_in=Stockholm%2c%%20%Sweden
423 n11 Tplace=village,addr:county=le%20%havre
426 | object | class | type | address |
427 | N10 | place | village | 'is_in' : 'Stockholm, Sweden' |
428 | N11 | place | village | 'county' : 'le havre' |
430 Scenario: Import of admin level
431 When loading osm data
433 n10 Tamenity=hospital,admin_level=3
434 n11 Tamenity=hospital,admin_level=b
435 n12 Tamenity=hospital
436 n13 Tamenity=hospital,admin_level=3.0
439 | object | class | type | admin_level |
440 | N10 | amenity | hospital | 3 |
441 | N11 | amenity | hospital | 15 |
442 | N12 | amenity | hospital | 15 |
443 | N13 | amenity | hospital | 3 |
445 Scenario Outline: Import of extra tags
446 When loading osm data
448 n10 Ttourism=hotel,<key>=foo
451 | object | class | type | extratags |
452 | N10 | tourism | hotel | '<key>' : 'foo' |
527 | name:etymology:wikidata |
530 When loading osm data
532 n10 Ttourism=hotel,building=yes
534 n12 Tbuilding=shed,addr:housenumber=1
535 n13 Tbuilding=yes,name=Das-Haus
536 n14 Tbuilding=yes,addr:postcode=12345
539 | object | class | type |
540 | N10 | tourism | hotel |
541 | N12 | building| yes |
542 | N13 | building| yes |
543 | N14 | building| yes |
544 And place has no entry for N10:building
545 And place has no entry for N11
547 Scenario: complete node entry
548 When loading osm data
550 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
553 | object | class | type | address |
554 | N290393920 | place | house| 'city' : 'Perpignan', 'country' : 'FR', 'housenumber' : '43\\', 'postcode' : '66000', 'street' : 'Rue Pierre Constant d`Ivry' |