]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/osm2pgsql/import/tags.feature
cb32593aa0884ac3e073483b3dbf02db5923c7c4
[nominatim.git] / tests / features / osm2pgsql / import / tags.feature
1 @DB
2 Feature: Tag evaluation
3     Tests if tags are correctly imported into the place table
4
5     Scenario Outline: Name tags
6         Given the osm nodes:
7          | id | tags
8          | 1  | 'highway' : 'yes', '<nametag>' : 'Foo'
9         When loading osm data
10         Then table place contains
11          | object | name
12          | N1     | '<nametag>' : 'Foo'
13
14     Examples:
15      | nametag
16      | ref
17      | int_ref
18      | nat_ref
19      | reg_ref
20      | loc_ref
21      | old_ref
22      | iata
23      | icao
24      | pcode:1
25      | pcode:2
26      | pcode:3
27      | name
28      | name:de
29      | name:bt-BR
30      | int_name
31      | int_name:xxx
32      | nat_name
33      | nat_name:fr
34      | reg_name
35      | reg_name:1
36      | loc_name
37      | loc_name:DE
38      | old_name
39      | old_name:v1
40      | alt_name
41      | alt_name:dfe
42      | alt_name_1
43      | official_name
44      | common_name
45      | common_name:pot
46      | short_name
47      | short_name:CH
48      | operator
49      | addr:housename
50
51     Scenario Outline: Ignored name tags
52         Given the osm nodes:
53          | id | tags
54          | 1  | 'highway' : 'yes', '<nametag>' : 'Foo', 'name' : 'real'
55         When loading osm data
56         Then table place contains
57          | object | name
58          | N1     | 'name' : 'real'
59
60     Examples:
61      | nametag
62      | name_de
63      | Name
64      | ref:de
65      | ref_de
66      | my:ref
67      | br:name
68      | name:prefix
69
70     Scenario: Special character in name tag
71         Given the osm nodes:
72          | id | tags
73          | 1  | 'highway' : 'yes', 'name: de' : 'Foo', 'name' : 'real'
74          | 2  | 'highway' : 'yes', 'name:\nde' : 'Foo', 'name' : 'real'
75          | 3  | 'highway' : 'yes', 'name:\tde' : 'Foo', 'name:\\' : 'real'
76         When loading osm data
77         Then table place contains
78          | object | name
79          | N1     | 'name:_de' : 'Foo', 'name' : 'real'
80          | N2     | 'name:_de' : 'Foo', 'name' : 'real'
81          | N3     | 'name:_de' : 'Foo', 'name:\\\\' : 'real'
82
83     Scenario Outline: Included places
84         Given the osm nodes:
85          | id | tags
86          | 1  | '<key>' : '<value>', 'name' : 'real'
87         When loading osm data
88         Then table place contains
89          | object | name
90          | N1     | 'name' : 'real'
91
92     Examples:
93      | key       | value
94      | emergency | phone
95      | tourism   | information
96      | historic  | castle
97      | military  | barracks
98      | natural   | water
99      | highway   | residential
100      | aerialway | station
101      | aeroway   | way
102      | boundary  | administrative
103      | bridge    | yes
104      | craft     | butcher
105      | leisure   | playground
106      | office    | bookmaker
107      | railway   | rail
108      | shop      | bookshop
109      | tunnel    | yes
110      | waterway  | stream
111      | landuse   | cemetry
112
113
114
115     Scenario Outline: Excluded places
116         Given the osm nodes:
117          | id | tags
118          | 1  | '<key>' : '<value>', 'name' : 'real'
119          | 2  | 'highway' : 'motorway', 'name' : 'To Hell'
120         When loading osm data
121         Then table place has no entry for N1
122
123     Examples:
124      | key       | value
125      | emergency | yes
126      | emergency | no
127      | tourism   | yes
128      | tourism   | no
129      | historic  | yes
130      | historic  | no
131      | military  | yes
132      | military  | no
133      | natural   | yes
134      | natural   | no
135      | highway   | no
136      | highway   | turning_circle
137      | highway   | traffic_signals
138      | highway   | mini_roundabout
139      | highway   | noexit
140      | highway   | crossing
141      | aerialway | no
142      | aeroway   | no
143      | amenity   | no
144      | boundary  | no
145      | bridge    | no
146      | craft     | no
147      | leisure   | no
148      | office    | no
149      | railway   | no
150      | shop      | no
151      | tunnel    | no
152      | waterway  | riverbank
153
154
155     Scenario: Boundary with place tag
156         Given the osm nodes:
157           | id  | geometry
158           | 200 | 0 0
159           | 201 | 0 1
160           | 202 | 1 1
161           | 203 | 1 0
162         And the osm ways:
163           | id | tags                                           | nodes
164           | 2  | 'boundary' : 'administrative', 'place' : 'city' | 200 201 202 203 200
165           | 20 | 'place' : 'city'                                | 200 201 202 203 200
166           | 40 | 'place' : 'city', 'boundary' : 'statistical'    | 200 201 202 203 200
167         When loading osm data
168         Then table place contains
169           | object       | class    | type           | extratags
170           | W2           | boundary | administrative | 'place' : 'city'
171           | W20          | place    | city           |
172           | W40:boundary | boundary | statistical    |
173           | W40:place    | place    | city           |
174         And table place has no entry for W2:place
175
176     Scenario Outline: Tags that describe a house
177         Given the osm nodes:
178           | id  | tags
179           | 100 | '<key>' : '<value>'
180           | 999 | 'amenity' : 'prison', '<key>' : '<value>'
181         When loading osm data
182         Then table place contains
183           | object | class   | type
184           | N100   | place   | house
185           | N999   | amenity | prison
186         And table place has no entry for N100:<key>
187         And table place has no entry for N999:<key>
188         And table place has no entry for N999:place
189
190     Examples:
191       | key                     | value
192       | addr:housename          | My Mansion
193       | addr:housenumber        | 456
194       | addr:conscriptionnumber | 4
195       | addr:streetnumber       | 4568765
196
197     Scenario: Only named with no other interesting tag
198         Given the osm nodes:
199           | id  | tags
200           | 1   | 'landuse' : 'meadow'
201           | 2   | 'landuse' : 'residential', 'name' : 'important'
202           | 3   | 'landuse' : 'residential', 'name' : 'important', 'place' : 'hamlet'
203         When loading osm data
204         Then table place contains
205           | object | class   | type
206           | N2     | landuse | residential
207           | N3     | place   | hamlet
208         And table place has no entry for N1
209         And table place has no entry for N3:landuse
210
211     Scenario Outline: Import of postal codes
212         Given the osm nodes:
213           | id  | tags
214           | 10  | 'place' : 'village', '<key>' : '<value>'
215         When loading osm data
216         Then table place contains
217           | object | class   | type    | postcode
218           | N10    | place   | village | <value>
219
220     Examples:
221       | key              | value
222       | postal_code      | 45736
223       | post_code        | gf4 65g
224       | postcode         | xxx
225       | addr:postcode    | 564
226       | tiger:zip_left   | 00011
227       | tiger:zip_right  | 09123
228
229     Scenario: Import of street and place
230         Given the osm nodes:
231           | id  | tags
232           | 10  | 'amenity' : 'hospital', 'addr:street' : 'Foo St'
233           | 20  | 'amenity' : 'hospital', 'addr:place' : 'Foo Town'
234         When loading osm data
235         Then table place contains
236           | object | class   | type     | street  | addr_place
237           | N10    | amenity | hospital | Foo St  | None
238           | N20    | amenity | hospital | None    | Foo Town
239