2 Feature: Tag evaluation
3 Tests if tags are correctly imported into the place table
5 Scenario: Main tags as fallback
8 n100 Tjunction=yes,highway=bus_stop
9 n101 Tjunction=yes,name=Bar
10 n200 Tbuilding=yes,amenity=cafe
11 n201 Tbuilding=yes,name=Intersting
14 Then place contains exactly
15 | object | class | type |
16 | N100 | highway | bus_stop |
17 | N101 | junction | yes |
18 | N200 | amenity | cafe |
19 | N201 | building | yes |
22 Scenario: Name and reg tags
25 n2001 Thighway=road,name=Foo,alt_name:de=Bar,ref=45
26 n2002 Thighway=road,name:prefix=Pre,name:suffix=Post,ref:de=55
27 n2003 Thighway=yes,name:%20%de=Foo,name=real1
28 n2004 Thighway=yes,name:%a%de=Foo,name=real2
29 n2005 Thighway=yes,name:%9%de=Foo,name:\\=real3
30 n2006 Thighway=yes,name:%9%de=Foo,name=rea\l3
32 Then place contains exactly
33 | object | class | type | name |
34 | N2001 | highway | road | 'name': 'Foo', 'alt_name:de': 'Bar', 'ref': '45' |
35 | N2002 | highway | road | - |
36 | N2003 | highway | yes | 'name: de': 'Foo', 'name': 'real1' |
37 | N2004 | highway | yes | 'name:\nde': 'Foo', 'name': 'real2' |
38 | N2005 | highway | yes | 'name:\tde': 'Foo', 'name:\\\\': 'real3' |
39 | N2006 | highway | yes | 'name:\tde': 'Foo', 'name': 'rea\\l3' |
42 | object | extratags |
43 | N2002 | 'name:prefix': 'Pre', 'name:suffix': 'Post', 'ref:de': '55' |
46 Scenario: Name when using with_name flag
49 n3001 Tbridge=yes,bridge:name=GoldenGate
50 n3002 Tbridge=yes,bridge:name:en=Rainbow
52 Then place contains exactly
53 | object | class | type | name |
54 | N3001 | bridge | yes | 'name': 'GoldenGate' |
55 | N3002 | bridge | yes | 'name:en': 'Rainbow' |
58 Scenario: Address tags
61 n4001 Taddr:housenumber=34,addr:city=Esmarald,addr:county=Land
62 n4002 Taddr:streetnumber=10,is_in:city=Rootoo,is_in=Gold
64 Then place contains exactly
65 | object | class | address |
66 | N4001 | place | 'housenumber': '34', 'city': 'Esmarald', 'county': 'Land' |
67 | N4002 | place | 'streetnumber': '10', 'city': 'Rootoo' |
70 Scenario: Country codes
73 n5001 Tshop=yes,country_code=DE
74 n5002 Tshop=yes,country_code=toolong
75 n5003 Tshop=yes,country_code=x
76 n5004 Tshop=yes,addr:country=us
77 n5005 Tshop=yes,country=be
78 n5006 Tshop=yes,addr:country=France
80 Then place contains exactly
81 | object | class | address |
82 | N5001 | shop | 'country': 'DE' |
85 | N5004 | shop | 'country': 'us' |
93 n6001 Tshop=bank,addr:postcode=12345
94 n6002 Tshop=bank,tiger:zip_left=34343
95 n6003 Tshop=bank,is_in:postcode=9009
97 Then place contains exactly
98 | object | class | address |
99 | N6001 | shop | 'postcode': '12345' |
100 | N6002 | shop | 'postcode': '34343' |
104 Scenario: Postcode areas
105 When loading osm data
107 n1 x12.36853 y51.50618
108 n2 x12.36853 y51.42362
109 n3 x12.63666 y51.42362
110 n4 x12.63666 y51.50618
111 w1 Tboundary=postal_code,ref=3456 Nn1,n2,n3,n4,n1
113 Then place contains exactly
114 | object | class | type | name |
115 | W1 | boundary | postal_code | 'ref': '3456' |
117 Scenario: Main with extra
118 When loading osm data
120 n7001 Thighway=primary,bridge=yes,name=1
121 n7002 Thighway=primary,bridge=yes,bridge:name=1
123 Then place contains exactly
124 | object | class | type | name | extratags+bridge:name |
125 | N7001 | highway | primary | 'name': '1' | - |
126 | N7002:highway | highway | primary | - | 1 |
127 | N7002:bridge | bridge | yes | 'name': '1' | 1 |
130 Scenario: Global fallback and skipping
131 When loading osm data
133 n8001 Tshop=shoes,note:de=Nein,xx=yy
134 n8002 Tshop=shoes,natural=no,ele=234
135 n8003 Tshop=shoes,name:source=survey
137 Then place contains exactly
138 | object | class | name | extratags |
139 | N8001 | shop | - | 'xx': 'yy' |
140 | N8002 | shop | - | 'ele': '234' |
141 | N8003 | shop | - | - |
144 Scenario: Admin levels
145 When loading osm data
148 n9002 Tplace=city,admin_level=16
149 n9003 Tplace=city,admin_level=x
150 n9004 Tplace=city,admin_level=1
151 n9005 Tplace=city,admin_level=0
152 n9006 Tplace=city,admin_level=2.5
154 Then place contains exactly
155 | object | class | admin_level |
156 | N9001 | place | 15 |
157 | N9002 | place | 15 |
158 | N9003 | place | 15 |
159 | N9004 | place | 1 |
160 | N9005 | place | 15 |
161 | N9006 | place | 15 |
164 Scenario: Administrative boundaries with place tags
165 When loading osm data
167 n10001 Tboundary=administrative,place=city,name=A
168 n10002 Tboundary=natural,place=city,name=B
169 n10003 Tboundary=administrative,place=island,name=C
172 | object | class | type | extratags |
173 | N10001 | boundary | administrative | 'place': 'city' |
175 | object | class | type |
176 | N10002:boundary | boundary | natural |
177 | N10002:place | place | city |
178 | N10003:boundary | boundary | administrative |
179 | N10003:place | place | island |
182 Scenario: Building fallbacks
183 When loading osm data
185 n12001 Ttourism=hotel,building=yes
186 n12002 Tbuilding=house
187 n12003 Tbuilding=shed,addr:housenumber=1
188 n12004 Tbuilding=yes,name=Das-Haus
189 n12005 Tbuilding=yes,addr:postcode=12345
191 Then place contains exactly
192 | object | class | type |
193 | N12001 | tourism | hotel |
194 | N12003 | building | shed |
195 | N12004 | building | yes |
196 | N12005 | place | postcode |
199 Scenario: Address interpolations
200 When loading osm data
202 n13001 Taddr:interpolation=odd
203 n13002 Taddr:interpolation=even,place=city
205 Then place contains exactly
206 | object | class | type | address |
207 | N13001 | place | houses | 'interpolation': 'odd' |
208 | N13002 | place | houses | 'interpolation': 'even' |
212 When loading osm data
216 w1 Thighway=footway Nn1,n2
217 w2 Thighway=footway,name=Road Nn1,n2
218 w3 Thighway=footway,name=Road,footway=sidewalk Nn1,n2
219 w4 Thighway=footway,name=Road,footway=crossing Nn1,n2
220 w5 Thighway=footway,name=Road,footway=residential Nn1,n2
222 Then place contains exactly
223 | object | name+name |
228 Scenario: Tourism information
229 When loading osm data
231 n100 Ttourism=information
232 n101 Ttourism=information,name=Generic
233 n102 Ttourism=information,information=guidepost
234 n103 Thighway=information,information=house
236 Then place contains exactly
238 | N101:tourism | information |
239 | N102:information | guidepost |
240 | N103:highway | information |
243 Scenario: Water feautures
244 When loading osm data
247 n21 Tnatural=water,name=SomePond
248 n22 Tnatural=water,water=pond
249 n23 Tnatural=water,water=pond,name=Pond
250 n24 Tnatural=water,water=river,name=BigRiver
251 n25 Tnatural=water,water=yes
252 n26 Tnatural=water,water=yes,name=Random
254 Then place contains exactly
256 | N21:natural | water |
258 | N26:natural | water |
260 Scenario: Drop name for address fallback
261 When loading osm data
263 n1 Taddr:housenumber=23,name=Foo
264 n2 Taddr:housenumber=23,addr:housename=Foo
265 n3 Taddr:housenumber=23
267 Then place contains exactly
268 | object | type | address | name |
269 | N1:place | house | 'housenumber': '23' | - |
270 | N2:place | house | 'housenumber': '23' | 'addr:housename': 'Foo' |
271 | N3:place | house | 'housenumber': '23' | - |
274 Scenario: Waterway locks
275 When loading osm data
277 n1 Twaterway=river,lock=yes
278 n2 Twaterway=river,lock=yes,lock_name=LeLock
279 n3 Twaterway=river,lock=yes,name=LeWater
280 n4 Tamenity=parking,lock=yes,lock_name=Gold
282 Then place contains exactly
283 | object | type | name |
284 | N2:lock | yes | 'name': 'LeLock' |
285 | N3:waterway | river | 'name': 'LeWater' |
286 | N4:amenity | parking | - |