From 8c89b65082ae9b0aab029bc9aa17562eef24c860 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 13 Jan 2015 22:16:00 +0100 Subject: [PATCH] more osm2pgsql tag tests --- tests/features/osm2pgsql/import/tags.feature | 162 ++++++++++++++++++- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/tests/features/osm2pgsql/import/tags.feature b/tests/features/osm2pgsql/import/tags.feature index 37940756..cb32593a 100644 --- a/tests/features/osm2pgsql/import/tags.feature +++ b/tests/features/osm2pgsql/import/tags.feature @@ -46,6 +46,7 @@ Feature: Tag evaluation | short_name | short_name:CH | operator + | addr:housename Scenario Outline: Ignored name tags Given the osm nodes: @@ -63,7 +64,8 @@ Feature: Tag evaluation | ref:de | ref_de | my:ref - : br:name + | br:name + | name:prefix Scenario: Special character in name tag Given the osm nodes: @@ -77,3 +79,161 @@ Feature: Tag evaluation | N1 | 'name:_de' : 'Foo', 'name' : 'real' | N2 | 'name:_de' : 'Foo', 'name' : 'real' | N3 | 'name:_de' : 'Foo', 'name:\\\\' : 'real' + + Scenario Outline: Included places + Given the osm nodes: + | id | tags + | 1 | '' : '', 'name' : 'real' + When loading osm data + Then table place contains + | object | name + | N1 | 'name' : 'real' + + Examples: + | key | value + | emergency | phone + | tourism | information + | historic | castle + | military | barracks + | natural | water + | highway | residential + | aerialway | station + | aeroway | way + | boundary | administrative + | bridge | yes + | craft | butcher + | leisure | playground + | office | bookmaker + | railway | rail + | shop | bookshop + | tunnel | yes + | waterway | stream + | landuse | cemetry + + + + Scenario Outline: Excluded places + Given the osm nodes: + | id | tags + | 1 | '' : '', 'name' : 'real' + | 2 | 'highway' : 'motorway', 'name' : 'To Hell' + When loading osm data + Then table place has no entry for N1 + + Examples: + | key | value + | emergency | yes + | emergency | no + | tourism | yes + | tourism | no + | historic | yes + | historic | no + | military | yes + | military | no + | natural | yes + | natural | no + | highway | no + | highway | turning_circle + | highway | traffic_signals + | highway | mini_roundabout + | highway | noexit + | highway | crossing + | aerialway | no + | aeroway | no + | amenity | no + | boundary | no + | bridge | no + | craft | no + | leisure | no + | office | no + | railway | no + | shop | no + | tunnel | no + | waterway | riverbank + + + Scenario: Boundary with place tag + Given the osm nodes: + | id | geometry + | 200 | 0 0 + | 201 | 0 1 + | 202 | 1 1 + | 203 | 1 0 + And the osm ways: + | id | tags | nodes + | 2 | 'boundary' : 'administrative', 'place' : 'city' | 200 201 202 203 200 + | 20 | 'place' : 'city' | 200 201 202 203 200 + | 40 | 'place' : 'city', 'boundary' : 'statistical' | 200 201 202 203 200 + When loading osm data + Then table place contains + | object | class | type | extratags + | W2 | boundary | administrative | 'place' : 'city' + | W20 | place | city | + | W40:boundary | boundary | statistical | + | W40:place | place | city | + And table place has no entry for W2:place + + Scenario Outline: Tags that describe a house + Given the osm nodes: + | id | tags + | 100 | '' : '' + | 999 | 'amenity' : 'prison', '' : '' + When loading osm data + Then table place contains + | object | class | type + | N100 | place | house + | N999 | amenity | prison + And table place has no entry for N100: + And table place has no entry for N999: + And table place has no entry for N999:place + + Examples: + | key | value + | addr:housename | My Mansion + | addr:housenumber | 456 + | addr:conscriptionnumber | 4 + | addr:streetnumber | 4568765 + + Scenario: Only named with no other interesting tag + Given the osm nodes: + | id | tags + | 1 | 'landuse' : 'meadow' + | 2 | 'landuse' : 'residential', 'name' : 'important' + | 3 | 'landuse' : 'residential', 'name' : 'important', 'place' : 'hamlet' + When loading osm data + Then table place contains + | object | class | type + | N2 | landuse | residential + | N3 | place | hamlet + And table place has no entry for N1 + And table place has no entry for N3:landuse + + Scenario Outline: Import of postal codes + Given the osm nodes: + | id | tags + | 10 | 'place' : 'village', '' : '' + When loading osm data + Then table place contains + | object | class | type | postcode + | N10 | place | village | + + Examples: + | key | value + | postal_code | 45736 + | post_code | gf4 65g + | postcode | xxx + | addr:postcode | 564 + | tiger:zip_left | 00011 + | tiger:zip_right | 09123 + + Scenario: Import of street and place + Given the osm nodes: + | id | tags + | 10 | 'amenity' : 'hospital', 'addr:street' : 'Foo St' + | 20 | 'amenity' : 'hospital', 'addr:place' : 'Foo Town' + When loading osm data + Then table place contains + | object | class | type | street | addr_place + | N10 | amenity | hospital | Foo St | None + | N20 | amenity | hospital | None | Foo Town + -- 2.39.5