mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-25 14:02:12 +03:00
more osm2pgsql tag tests
This commit is contained in:
parent
f156da6b63
commit
8c89b65082
@ -46,6 +46,7 @@ Feature: Tag evaluation
|
|||||||
| short_name
|
| short_name
|
||||||
| short_name:CH
|
| short_name:CH
|
||||||
| operator
|
| operator
|
||||||
|
| addr:housename
|
||||||
|
|
||||||
Scenario Outline: Ignored name tags
|
Scenario Outline: Ignored name tags
|
||||||
Given the osm nodes:
|
Given the osm nodes:
|
||||||
@ -63,7 +64,8 @@ Feature: Tag evaluation
|
|||||||
| ref:de
|
| ref:de
|
||||||
| ref_de
|
| ref_de
|
||||||
| my:ref
|
| my:ref
|
||||||
: br:name
|
| br:name
|
||||||
|
| name:prefix
|
||||||
|
|
||||||
Scenario: Special character in name tag
|
Scenario: Special character in name tag
|
||||||
Given the osm nodes:
|
Given the osm nodes:
|
||||||
@ -77,3 +79,161 @@ Feature: Tag evaluation
|
|||||||
| N1 | 'name:_de' : 'Foo', 'name' : 'real'
|
| N1 | 'name:_de' : 'Foo', 'name' : 'real'
|
||||||
| N2 | 'name:_de' : 'Foo', 'name' : 'real'
|
| N2 | 'name:_de' : 'Foo', 'name' : 'real'
|
||||||
| N3 | 'name:_de' : 'Foo', 'name:\\\\' : 'real'
|
| N3 | 'name:_de' : 'Foo', 'name:\\\\' : 'real'
|
||||||
|
|
||||||
|
Scenario Outline: Included places
|
||||||
|
Given the osm nodes:
|
||||||
|
| id | tags
|
||||||
|
| 1 | '<key>' : '<value>', '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 | '<key>' : '<value>', '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 | '<key>' : '<value>'
|
||||||
|
| 999 | 'amenity' : 'prison', '<key>' : '<value>'
|
||||||
|
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:<key>
|
||||||
|
And table place has no entry for N999:<key>
|
||||||
|
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', '<key>' : '<value>'
|
||||||
|
When loading osm data
|
||||||
|
Then table place contains
|
||||||
|
| object | class | type | postcode
|
||||||
|
| N10 | place | village | <value>
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user