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 Outline: Included places
100 When loading osm data
102 n1 T<key>=<value>,name=real
105 | object | class | type | name |
106 | N1 | <key> | <value> | 'name' : 'real' |
110 | emergency | phone |
111 | tourism | information |
112 | historic | castle |
113 | military | barracks |
115 | highway | residential |
116 | aerialway | station |
118 | boundary | administrative |
120 | leisure | playground |
121 | office | bookmaker |
124 | waterway | stream |
125 | landuse | cemetry |
127 | mountain_pass | yes |
129 Scenario Outline: Bridges and Tunnels take special name tags
130 When loading osm data
132 n1 Thighway=road,<key>=yes,name=Rd,<key>:name=My
133 n2 Thighway=road,<key>=yes,name=Rd
136 | object | type | name |
137 | N1:highway | road | 'name' : 'Rd' |
138 | N1:<key> | yes | 'name' : 'My' |
139 | N2:highway | road | 'name' : 'Rd' |
140 And place has no entry for N2:<key>
147 Scenario Outline: Excluded places
148 When loading osm data
150 n1 T<key>=<value>,name=real
151 n2 Thighway=motorway,name=To%20%Hell
153 Then place has no entry for N1
168 | highway | turning_circle |
169 | highway | mini_roundabout |
171 | highway | crossing |
173 | aerialway | pylon |
174 | man_made | survey_point |
175 | man_made | cutline |
183 | railway | level_crossing |
186 | waterway | riverbank |
188 Scenario Outline: Some tags only are included when named
189 When loading osm data
192 n2 T<key>=<value>,name=To%20%Hell
193 n3 T<key>=<value>,ref=123
195 Then place contains exactly
196 | object | class | type |
197 | N2 | <key> | <value> |
201 | landuse | residential |
203 | highway | traffic_signals |
204 | highway | service |
205 | highway | cycleway |
207 | highway | footway |
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 |
219 | waterway | stream |
221 Scenario: Footways are not included if they are sidewalks
222 When loading osm data
224 n2 Thighway=footway,name=To%20%Hell,footway=sidewalk
225 n23 Thighway=footway,name=x
227 Then place has no entry for N2
229 Scenario: named junctions are included if there is no other tag
230 When loading osm data
233 n2 Thighway=secondary,junction=roundabout,name=To-Hell
234 n3 Tjunction=yes,name=Le%20%Croix
236 Then place has no entry for N1
237 And place has no entry for N2:junction
239 | object | class | type |
240 | N3 | junction | yes |
242 Scenario: Boundary with place tag
243 When loading osm data
249 w2 Tboundary=administrative,place=city,name=Foo Nn200,n201,n202,n203,n200
250 w4 Tboundary=administrative,place=island,name=Foo Nn200,n201,n202,n203,n200
251 w20 Tplace=city,name=ngng Nn200,n201,n202,n203,n200
252 w40 Tplace=city,boundary=statistical,name=BB Nn200,n201,n202,n203,n200
255 | object | class | extratags | type |
256 | W2 | boundary | 'place' : 'city' | administrative |
257 | W4:boundary | boundary | - | administrative |
258 | W4:place | place | - | island |
259 | W20 | place | - | city |
260 | W40:boundary | boundary | - | statistical |
261 | W40:place | place | - | city |
262 And place has no entry for W2:place
264 Scenario Outline: Tags that describe a house
265 When loading osm data
268 n999 Tamenity=prison,<key>=<value>
270 Then place contains exactly
271 | object | class | type |
272 | N100 | place | house |
273 | N999 | amenity | prison |
277 | addr:housename | My%20%Mansion |
278 | addr:housenumber | 456 |
279 | addr:conscriptionnumber | 4 |
280 | addr:streetnumber | 4568765 |
282 Scenario: Only named with no other interesting tag
283 When loading osm data
286 n2 Tlanduse=residential,name=important
287 n3 Tlanduse=residential,name=important,place=hamlet
290 | object | class | type |
291 | N2 | landuse | residential |
292 | N3 | place | hamlet |
293 And place has no entry for N1
294 And place has no entry for N3:landuse
296 Scenario Outline: Import of postal codes
297 When loading osm data
299 n10 Thighway=secondary,<key>=<value>
303 | object | class | type | addr+postcode |
304 | N10 | highway | secondary | <value> |
305 | N11 | place | postcode | <value> |
306 And place has no entry for N10:place
310 | postal_code | 45736 |
312 | addr:postcode | 564 |
313 | tiger:zip_left | 00011 |
314 | tiger:zip_right | 09123 |
316 Scenario: Import of street and place
317 When loading osm data
319 n10 Tamenity=hospital,addr:street=Foo%20%St
320 n20 Tamenity=hospital,addr:place=Foo%20%Town
323 | object | class | type | addr+street | addr+place |
324 | N10 | amenity | hospital | Foo St | - |
325 | N20 | amenity | hospital | - | Foo Town |
328 Scenario Outline: Import of country
329 When loading osm data
331 n10 Tplace=village,<key>=<value>
334 | object | class | type | addr+country |
335 | N10 | place | village | <value> |
339 | country_code | us |
341 | is_in:country_code | __ |
342 | addr:country | .. |
343 | addr:country_code | cv |
345 Scenario Outline: Ignore country codes with wrong length
346 When loading osm data
348 n10 Tplace=village,country_code=<value>
351 | object | class | type | addr+country |
352 | N10 | place | village | - |
362 Scenario: Import of house numbers
363 When loading osm data
365 n10 Tbuilding=yes,addr:housenumber=4b
366 n11 Tbuilding=yes,addr:conscriptionnumber=003
367 n12 Tbuilding=yes,addr:streetnumber=2345
368 n13 Tbuilding=yes,addr:conscriptionnumber=3,addr:streetnumber=111
371 | object | class | type | address |
372 | N10 | building | yes | 'housenumber' : '4b' |
373 | N11 | building | yes | 'conscriptionnumber' : '003' |
374 | N12 | building | yes | 'streetnumber' : '2345' |
375 | N13 | building | yes | 'conscriptionnumber' : '3', 'streetnumber' : '111' |
377 Scenario: Shorten tiger:county tags
378 When loading osm data
380 n10 Tplace=village,tiger:county=Feebourgh%2c%%20%AL
381 n11 Tplace=village,addr:state=Alabama,tiger:county=Feebourgh%2c%%20%AL
382 n12 Tplace=village,tiger:county=Feebourgh
385 | object | class | type | addr+tiger:county |
386 | N10 | place | village | Feebourgh county |
387 | N11 | place | village | Feebourgh county |
388 | N12 | place | village | Feebourgh county |
390 Scenario Outline: Import of address tags
391 When loading osm data
393 n10 Tplace=village,addr:<key>=<value>
394 n11 Tplace=village,is_in:<key>=<value>
397 | object | class | type | address |
398 | N10 | place | village | '<key>' : '<value>' |
406 Scenario: Import of isin tags with space
407 When loading osm data
409 n10 Tplace=village,is_in=Stockholm%2c%%20%Sweden
410 n11 Tplace=village,addr:county=le%20%havre
413 | object | class | type | address |
414 | N10 | place | village | 'is_in' : 'Stockholm, Sweden' |
415 | N11 | place | village | 'county' : 'le havre' |
417 Scenario: Import of admin level
418 When loading osm data
420 n10 Tamenity=hospital,admin_level=3
421 n11 Tamenity=hospital,admin_level=b
422 n12 Tamenity=hospital
423 n13 Tamenity=hospital,admin_level=3.0
426 | object | class | type | admin_level |
427 | N10 | amenity | hospital | 3 |
428 | N11 | amenity | hospital | 15 |
429 | N12 | amenity | hospital | 15 |
430 | N13 | amenity | hospital | 3 |
432 Scenario Outline: Import of extra tags
433 When loading osm data
435 n10 Ttourism=hotel,<key>=foo
438 | object | class | type | extratags |
439 | N10 | tourism | hotel | '<key>' : 'foo' |
514 | name:etymology:wikidata |
517 When loading osm data
519 n10 Ttourism=hotel,building=yes
521 n12 Tbuilding=shed,addr:housenumber=1
522 n13 Tbuilding=yes,name=Das-Haus
523 n14 Tbuilding=yes,addr:postcode=12345
526 | object | class | type |
527 | N10 | tourism | hotel |
528 | N12 | building| yes |
529 | N13 | building| yes |
530 | N14 | building| yes |
531 And place has no entry for N10:building
532 And place has no entry for N11
534 Scenario: complete node entry
535 When loading osm data
537 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
540 | object | class | type | address |
541 | N290393920 | place | house| 'city' : 'Perpignan', 'country' : 'FR', 'housenumber' : '43\\', 'postcode' : '66000', 'street' : 'Rue Pierre Constant d`Ivry' |