]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/osm2pgsql/import/tags.feature
adapt API tests to latest data
[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      | mountain_pass | yes
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  | 'highway' : 'secondary', '<key>' : '<value>'
215           | 11  | '<key>' : '<value>'
216         When loading osm data
217         Then table place contains
218           | object | class   | type      | postcode
219           | N10    | highway | secondary | <value>
220           | N11    | place   | postcode  | <value>
221         And table place has no entry for N10:place
222
223     Examples:
224       | key              | value
225       | postal_code      | 45736
226       | post_code        | gf4 65g
227       | postcode         | xxx
228       | addr:postcode    | 564
229       | tiger:zip_left   | 00011
230       | tiger:zip_right  | 09123
231
232     Scenario: Import of street and place
233         Given the osm nodes:
234           | id  | tags
235           | 10  | 'amenity' : 'hospital', 'addr:street' : 'Foo St'
236           | 20  | 'amenity' : 'hospital', 'addr:place' : 'Foo Town'
237         When loading osm data
238         Then table place contains
239           | object | class   | type     | street  | addr_place
240           | N10    | amenity | hospital | Foo St  | None
241           | N20    | amenity | hospital | None    | Foo Town
242
243
244     Scenario Outline: Import of country
245         Given the osm nodes:
246           | id  | tags
247           | 10  | 'place' : 'village', '<key>' : '<value>'
248         When loading osm data
249         Then table place contains
250           | object | class   | type    | country_code
251           | N10    | place   | village | <value>
252
253     Examples:
254         | key                            | value
255         | country_code_iso3166_1_alpha_2 | gb
256         | country_code_iso3166_1         | UK
257         | country_code_iso3166           | de
258         | country_code                   | us
259         | iso3166-1:alpha2               | aU
260         | iso3166-1                      | 12
261         | ISO3166-1                      | XX
262         | iso3166                        | Nl
263         | is_in:country_code             | __
264         | addr:country                   | ..
265         | addr:country_code              | cv
266
267     Scenario Outline: Ignore country codes with wrong length
268         Given the osm nodes:
269           | id  | tags
270           | 10  | 'place' : 'village', 'country_code' : '<value>'
271         When loading osm data
272         Then table place contains
273           | object | class   | type    | country_code
274           | N10    | place   | village | None
275
276     Examples:
277         | value
278         | X
279         | x
280         | ger
281         | dkeufr
282         | d e
283
284     Scenario: Import of house numbers
285         Given the osm nodes:
286           | id  | tags
287           | 10  | 'building' : 'yes', 'addr:housenumber' : '4b'
288           | 11  | 'building' : 'yes', 'addr:conscriptionnumber' : '003'
289           | 12  | 'building' : 'yes', 'addr:streetnumber' : '2345'
290           | 13  | 'building' : 'yes', 'addr:conscriptionnumber' : '3', 'addr:streetnumber' : '111'
291         When loading osm data
292         Then table place contains
293           | object | class | type   | housenumber
294           | N10    | place | house  | 4b
295           | N11    | place | house  | 003
296           | N12    | place | house  | 2345
297           | N13    | place | house  | 3/111
298
299     Scenario: Import of address interpolations
300         Given the osm nodes:
301           | id  | tags
302           | 10  | 'addr:interpolation' : 'odd'
303           | 11  | 'addr:housenumber' : '10', 'addr:interpolation' : 'odd'
304           | 12  | 'addr:interpolation' : 'odd', 'addr:housenumber' : '23'
305         When loading osm data
306         Then table place contains
307           | object | class   | type    | housenumber
308           | N10    | place   | houses  | odd
309           | N11    | place   | houses  | odd
310           | N12    | place   | houses  | odd
311
312     Scenario: Shorten tiger:county tags
313         Given the osm nodes:
314           | id  | tags
315           | 10  | 'place' : 'village', 'tiger:county' : 'Feebourgh, AL'
316           | 11  | 'place' : 'village', 'addr:state' : 'Alabama', 'tiger:county' : 'Feebourgh, AL'
317         When loading osm data
318         Then table place contains
319           | object | class   | type    | isin
320           | N10    | place   | village | Feebourgh county
321           | N11    | place   | village | Alabama,Feebourgh county
322
323     Scenario Outline: Import of address tags
324         Given the osm nodes:
325           | id  | tags
326           | 10  | 'place' : 'village', '<key>' : '<value>'
327         When loading osm data
328         Then table place contains
329           | object | class   | type    | isin
330           | N10    | place   | village | <value>
331
332     Examples:
333       | key             | value
334       | is_in           | Stockholm, Sweden
335       | is_in:country   | Xanadu
336       | addr:suburb     | hinein
337       | addr:county     | le havre
338       | addr:city       | Sydney
339       | addr:state      | Jura
340
341     Scenario: Import of admin level
342         Given the osm nodes:
343           | id  | tags
344           | 10  | 'amenity' : 'hospital', 'admin_level' : '3'
345           | 11  | 'amenity' : 'hospital', 'admin_level' : 'b'
346         When loading osm data
347         Then table place contains
348           | object | class   | type     | admin_level
349           | N10    | amenity | hospital | 3
350           | N11    | amenity | hospital | 0
351
352     Scenario: Import of extra tags
353         Given the osm nodes:
354           | id  | tags
355           | 10  | 'tourism' : 'hotel', '<key>' : 'foo'
356         When loading osm data
357         Then table place contains
358           | object | class   | type  | extratags
359           | N10    | tourism | hotel | '<key>' : 'foo'
360
361      Examples:
362        | key
363        | tracktype
364        | traffic_calming
365        | service
366        | cuisine
367        | capital
368        | dispensing
369        | religion
370        | denomination
371        | sport
372        | internet_access
373        | lanes
374        | surface
375        | smoothness
376        | width
377        | est_width
378        | incline
379        | opening_hours
380        | food_hours
381        | collection_times
382        | service_times
383        | smoking_hours
384        | disused
385        | wheelchair
386        | sac_scale
387        | trail_visibility
388        | mtb:scale
389        | mtb:description
390        | wood
391        | drive_thru
392        | drive_in
393        | access
394        | vehicle
395        | bicyle
396        | foot
397        | goods
398        | hgv
399        | motor_vehicle
400        | motor_car
401        | access:foot
402        | contact:phone
403        | drink:mate
404        | oneway
405        | date_on
406        | date_off
407        | day_on
408        | day_off
409        | hour_on
410        | hour_off
411        | maxweight
412        | maxheight
413        | maxspeed
414        | disused
415        | toll
416        | charge
417        | population
418        | description
419        | image
420        | attribution
421        | fax
422        | email
423        | url
424        | website
425        | phone
426        | tel
427        | real_ale
428        | smoking
429        | food
430        | camera
431        | brewery
432        | locality
433        | wikipedia
434        | wikipedia:de
435
436     Scenario: buildings
437         Given the osm nodes:
438           | id  | tags
439           | 10  | 'tourism' : 'hotel', 'building' : 'yes'
440           | 11  | 'building' : 'house'
441           | 12  | 'building' : 'shed', 'addr:housenumber' : '1'
442           | 13  | 'building' : 'yes', 'name' : 'Das Haus'
443           | 14  | 'building' : 'yes', 'addr:postcode' : '12345'
444         When loading osm data
445         Then table place contains
446           | object | class   | type
447           | N10    | tourism | hotel
448           | N12    | place   | house
449           | N13    | building| yes
450           | N14    | building| yes
451         And table place has no entry for N10:building
452         And table place has no entry for N11