From 352f0fdc27d990ebd3b94bafc33eaa44f1e017c5 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 14 Jan 2015 23:13:38 +0100 Subject: [PATCH] finish osm2pgsql tag tests --- tests/features/osm2pgsql/import/tags.feature | 221 ++++++++++++++++++- 1 file changed, 217 insertions(+), 4 deletions(-) diff --git a/tests/features/osm2pgsql/import/tags.feature b/tests/features/osm2pgsql/import/tags.feature index cb32593a..d9046eec 100644 --- a/tests/features/osm2pgsql/import/tags.feature +++ b/tests/features/osm2pgsql/import/tags.feature @@ -109,7 +109,7 @@ Feature: Tag evaluation | tunnel | yes | waterway | stream | landuse | cemetry - + | mountain_pass | yes Scenario Outline: Excluded places @@ -211,11 +211,14 @@ Feature: Tag evaluation Scenario Outline: Import of postal codes Given the osm nodes: | id | tags - | 10 | 'place' : 'village', '' : '' + | 10 | 'highway' : 'secondary', '' : '' + | 11 | '' : '' When loading osm data Then table place contains - | object | class | type | postcode - | N10 | place | village | + | object | class | type | postcode + | N10 | highway | secondary | + | N11 | place | postcode | + And table place has no entry for N10:place Examples: | key | value @@ -237,3 +240,213 @@ Feature: Tag evaluation | N10 | amenity | hospital | Foo St | None | N20 | amenity | hospital | None | Foo Town + + Scenario Outline: Import of country + Given the osm nodes: + | id | tags + | 10 | 'place' : 'village', '' : '' + When loading osm data + Then table place contains + | object | class | type | country_code + | N10 | place | village | + + Examples: + | key | value + | country_code_iso3166_1_alpha_2 | gb + | country_code_iso3166_1 | UK + | country_code_iso3166 | de + | country_code | us + | iso3166-1:alpha2 | aU + | iso3166-1 | 12 + | ISO3166-1 | XX + | iso3166 | Nl + | is_in:country_code | __ + | addr:country | .. + | addr:country_code | cv + + Scenario Outline: Ignore country codes with wrong length + Given the osm nodes: + | id | tags + | 10 | 'place' : 'village', 'country_code' : '' + When loading osm data + Then table place contains + | object | class | type | country_code + | N10 | place | village | None + + Examples: + | value + | X + | x + | ger + | dkeufr + | d e + + Scenario: Import of house numbers + Given the osm nodes: + | id | tags + | 10 | 'building' : 'yes', 'addr:housenumber' : '4b' + | 11 | 'building' : 'yes', 'addr:conscriptionnumber' : '003' + | 12 | 'building' : 'yes', 'addr:streetnumber' : '2345' + | 13 | 'building' : 'yes', 'addr:conscriptionnumber' : '3', 'addr:streetnumber' : '111' + When loading osm data + Then table place contains + | object | class | type | housenumber + | N10 | place | house | 4b + | N11 | place | house | 003 + | N12 | place | house | 2345 + | N13 | place | house | 3/111 + + Scenario: Import of address interpolations + Given the osm nodes: + | id | tags + | 10 | 'addr:interpolation' : 'odd' + | 11 | 'addr:housenumber' : '10', 'addr:interpolation' : 'odd' + | 12 | 'addr:interpolation' : 'odd', 'addr:housenumber' : '23' + When loading osm data + Then table place contains + | object | class | type | housenumber + | N10 | place | houses | odd + | N11 | place | houses | odd + | N12 | place | houses | odd + + Scenario: Shorten tiger:county tags + Given the osm nodes: + | id | tags + | 10 | 'place' : 'village', 'tiger:county' : 'Feebourgh, AL' + | 11 | 'place' : 'village', 'addr:state' : 'Alabama', 'tiger:county' : 'Feebourgh, AL' + When loading osm data + Then table place contains + | object | class | type | isin + | N10 | place | village | Feebourgh county + | N11 | place | village | Alabama,Feebourgh county + + Scenario Outline: Import of address tags + Given the osm nodes: + | id | tags + | 10 | 'place' : 'village', '' : '' + When loading osm data + Then table place contains + | object | class | type | isin + | N10 | place | village | + + Examples: + | key | value + | is_in | Stockholm, Sweden + | is_in:country | Xanadu + | addr:suburb | hinein + | addr:county | le havre + | addr:city | Sydney + | addr:state | Jura + + Scenario: Import of admin level + Given the osm nodes: + | id | tags + | 10 | 'amenity' : 'hospital', 'admin_level' : '3' + | 11 | 'amenity' : 'hospital', 'admin_level' : 'b' + When loading osm data + Then table place contains + | object | class | type | admin_level + | N10 | amenity | hospital | 3 + | N11 | amenity | hospital | 0 + + Scenario: Import of extra tags + Given the osm nodes: + | id | tags + | 10 | 'tourism' : 'hotel', '' : 'foo' + When loading osm data + Then table place contains + | object | class | type | extratags + | N10 | tourism | hotel | '' : 'foo' + + Examples: + | key + | tracktype + | traffic_calming + | service + | cuisine + | capital + | dispensing + | religion + | denomination + | sport + | internet_access + | lanes + | surface + | smoothness + | width + | est_width + | incline + | opening_hours + | food_hours + | collection_times + | service_times + | smoking_hours + | disused + | wheelchair + | sac_scale + | trail_visibility + | mtb:scale + | mtb:description + | wood + | drive_thru + | drive_in + | access + | vehicle + | bicyle + | foot + | goods + | hgv + | motor_vehicle + | motor_car + | access:foot + | contact:phone + | drink:mate + | oneway + | date_on + | date_off + | day_on + | day_off + | hour_on + | hour_off + | maxweight + | maxheight + | maxspeed + | disused + | toll + | charge + | population + | description + | image + | attribution + | fax + | email + | url + | website + | phone + | tel + | real_ale + | smoking + | food + | camera + | brewery + | locality + | wikipedia + | wikipedia:de + + Scenario: buildings + Given the osm nodes: + | id | tags + | 10 | 'tourism' : 'hotel', 'building' : 'yes' + | 11 | 'building' : 'house' + | 12 | 'building' : 'shed', 'addr:housenumber' : '1' + | 13 | 'building' : 'yes', 'name' : 'Das Haus' + | 14 | 'building' : 'yes', 'addr:postcode' : '12345' + When loading osm data + Then table place contains + | object | class | type + | N10 | tourism | hotel + | N12 | place | house + | N13 | building| yes + | N14 | building| yes + And table place has no entry for N10:building + And table place has no entry for N11 -- 2.39.5