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: Main with extra
105 When loading osm data
107 n7001 Thighway=primary,bridge=yes,name=1
108 n7002 Thighway=primary,bridge=yes,bridge:name=1
110 Then place contains exactly
111 | object | class | type | name | extratags+bridge:name |
112 | N7001 | highway | primary | 'name': '1' | - |
113 | N7002:highway | highway | primary | - | 1 |
114 | N7002:bridge | bridge | yes | 'name': '1' | 1 |
117 Scenario: Global fallback and skipping
118 When loading osm data
120 n8001 Tshop=shoes,note:de=Nein,xx=yy
121 n8002 Tshop=shoes,building=no,ele=234
122 n8003 Tshop=shoes,name:source=survey
124 Then place contains exactly
125 | object | class | extratags |
126 | N8001 | shop | 'xx': 'yy' |
127 | N8002 | shop | 'ele': '234' |
131 Scenario: Admin levels
132 When loading osm data
135 n9002 Tplace=city,admin_level=16
136 n9003 Tplace=city,admin_level=x
137 n9004 Tplace=city,admin_level=1
138 n9005 Tplace=city,admin_level=0
139 n9006 Tplace=city,admin_level=2.5
141 Then place contains exactly
142 | object | class | admin_level |
143 | N9001 | place | 15 |
144 | N9002 | place | 15 |
145 | N9003 | place | 15 |
146 | N9004 | place | 1 |
147 | N9005 | place | 15 |
148 | N9006 | place | 15 |
151 Scenario: Administrative boundaries with place tags
152 When loading osm data
154 n10001 Tboundary=administrative,place=city,name=A
155 n10002 Tboundary=natural,place=city,name=B
156 n10003 Tboundary=administrative,place=island,name=C
159 | object | class | type | extratags |
160 | N10001 | boundary | administrative | 'place': 'city' |
162 | object | class | type |
163 | N10002:boundary | boundary | natural |
164 | N10002:place | place | city |
165 | N10003:boundary | boundary | administrative |
166 | N10003:place | place | island |
169 Scenario: Building fallbacks
170 When loading osm data
172 n12001 Ttourism=hotel,building=yes
173 n12002 Tbuilding=house
174 n12003 Tbuilding=shed,addr:housenumber=1
175 n12004 Tbuilding=yes,name=Das-Haus
176 n12005 Tbuilding=yes,addr:postcode=12345
178 Then place contains exactly
179 | object | class | type |
180 | N12001 | tourism | hotel |
181 | N12003 | building | shed |
182 | N12004 | building | yes |
183 | N12005 | place | postcode |
186 Scenario: Address interpolations
187 When loading osm data
189 n13001 Taddr:interpolation=odd
190 n13002 Taddr:interpolation=even,place=city
192 Then place contains exactly
193 | object | class | type | address |
194 | N13001 | place | houses | 'interpolation': 'odd' |
195 | N13002 | place | houses | 'interpolation': 'even' |