2 Feature: Parenting of objects
3 Tests that the correct parent is chosen
5 Scenario: Address inherits postcode from its street unless it has a postcode
6 Given the scene roads-with-pois
8 | osm | class | type | housenr | geometry |
9 | N1 | place | house | 4 | :p-N1 |
11 | osm | class | type | housenr | postcode | geometry |
12 | N2 | place | house | 5 | 99999 | :p-N1 |
14 | osm | class | type | name | postcode | geometry |
15 | W1 | highway | residential | galoo | 12345 | :w-north |
18 | object | parent_place_id |
21 When searching for "4 galoo"
23 | ID | osm_type | osm_id | langaddress
24 | 0 | N | 1 | 4, galoo, 12345
25 When searching for "5 galoo"
27 | ID | osm_type | osm_id | langaddress
28 | 0 | N | 2 | 5, galoo, 99999
30 Scenario: Address without tags, closest street
31 Given the scene roads-with-pois
33 | osm | class | type | geometry |
34 | N1 | place | house | :p-N1 |
35 | N2 | place | house | :p-N2 |
36 | N3 | place | house | :p-S1 |
37 | N4 | place | house | :p-S2 |
39 | osm | class | type | geometry |
40 | W1 | highway | residential | :w-north |
41 | W2 | highway | residential | :w-south |
44 | object | parent_place_id |
50 Scenario: Address without tags avoids unnamed streets
51 Given the scene roads-with-pois
53 | osm | class | type | geometry |
54 | N1 | place | house | :p-N1 |
55 | N2 | place | house | :p-N2 |
56 | N3 | place | house | :p-S1 |
57 | N4 | place | house | :p-S2 |
58 | W1 | highway | residential | :w-north |
60 | osm | class | type | geometry |
61 | W2 | highway | residential | :w-south |
64 | object | parent_place_id |
70 Scenario: addr:street tag parents to appropriately named street
71 Given the scene roads-with-pois
73 | osm | class | type | street| geometry |
74 | N1 | place | house | south | :p-N1 |
75 | N2 | place | house | north | :p-N2 |
76 | N3 | place | house | south | :p-S1 |
77 | N4 | place | house | north | :p-S2 |
79 | osm | class | type | name | geometry |
80 | W1 | highway | residential | north | :w-north |
81 | W2 | highway | residential | south | :w-south |
84 | object | parent_place_id |
90 Scenario: addr:street tag parents to next named street
91 Given the scene roads-with-pois
93 | osm | class | type | street | geometry |
94 | N1 | place | house | abcdef | :p-N1 |
95 | N2 | place | house | abcdef | :p-N2 |
96 | N3 | place | house | abcdef | :p-S1 |
97 | N4 | place | house | abcdef | :p-S2 |
99 | osm | class | type | name | geometry |
100 | W1 | highway | residential | abcdef | :w-north |
101 | W2 | highway | residential | abcdef | :w-south |
104 | object | parent_place_id |
110 Scenario: addr:street tag without appropriately named street
111 Given the scene roads-with-pois
113 | osm | class | type | street | geometry |
114 | N1 | place | house | abcdef | :p-N1 |
115 | N2 | place | house | abcdef | :p-N2 |
116 | N3 | place | house | abcdef | :p-S1 |
117 | N4 | place | house | abcdef | :p-S2 |
119 | osm | class | type | name | geometry |
120 | W1 | highway | residential | abcde | :w-north |
121 | W2 | highway | residential | abcde | :w-south |
124 | object | parent_place_id |
130 Scenario: addr:place address
131 Given the scene road-with-alley
133 | osm | class | type | addr_place | geometry |
134 | N1 | place | house | myhamlet | :n-alley |
136 | osm | class | type | name | geometry |
137 | N2 | place | hamlet | myhamlet | :n-main-west |
138 | W1 | highway | residential | myhamlet | :w-main |
141 | object | parent_place_id |
144 Scenario: addr:street is preferred over addr:place
145 Given the scene road-with-alley
147 | osm | class | type | addr_place | street | geometry |
148 | N1 | place | house | myhamlet | mystreet| :n-alley |
150 | osm | class | type | name | geometry |
151 | N2 | place | hamlet | myhamlet | :n-main-west |
152 | W1 | highway | residential | mystreet | :w-main |
155 | object | parent_place_id |
158 Scenario: Untagged address in simple associated street relation
159 Given the scene road-with-alley
161 | osm | class | type | geometry |
162 | N1 | place | house | :n-alley |
163 | N2 | place | house | :n-corner |
164 | N3 | place | house | :n-main-west |
166 | osm | class | type | name | geometry |
167 | W1 | highway | residential | foo | :w-main |
168 | W2 | highway | service | bar | :w-alley |
170 | id | members | tags+type |
171 | 1 | W1:street,N1,N2,N3 | associatedStreet |
174 | object | parent_place_id |
179 Scenario: Avoid unnamed streets in simple associated street relation
180 Given the scene road-with-alley
182 | osm | class | type | geometry |
183 | N1 | place | house | :n-alley |
184 | N2 | place | house | :n-corner |
185 | N3 | place | house | :n-main-west |
186 | W2 | highway | residential | :w-alley |
188 | osm | class | type | geometry |
189 | W1 | highway | residential | :w-main |
191 | id | members | tags+type |
192 | 1 | N1,N2,N3,W2:street,W1:street | associatedStreet |
195 | object | parent_place_id |
200 Scenario: Associated street relation overrides addr:street
201 Given the scene road-with-alley
203 | osm | class | type | street | geometry |
204 | N1 | place | house | bar | :n-alley |
206 | osm | class | type | name | geometry |
207 | W1 | highway | residential | foo | :w-main |
208 | W2 | highway | residential | bar | :w-alley |
210 | id | members | tags+type |
211 | 1 | W1:street,N1,N2,N3 | associatedStreet |
214 | object | parent_place_id |
217 Scenario: Building without tags, closest street from center point
218 Given the scene building-on-street-corner
220 | osm | class | type | geometry |
221 | W1 | building | yes | :w-building |
222 | W2 | highway | primary | :w-WE |
223 | W3 | highway | residential | :w-NS |
226 | object | parent_place_id |
229 Scenario: Building with addr:street tags
230 Given the scene building-on-street-corner
232 | osm | class | type | street | geometry |
233 | W1 | building | yes | bar | :w-building |
235 | osm | class | type | name | geometry |
236 | W2 | highway | primary | bar | :w-WE |
237 | W3 | highway | residential | foo | :w-NS |
240 | object | parent_place_id |
243 Scenario: Building with addr:place tags
244 Given the scene building-on-street-corner
246 | osm | class | type | name | geometry |
247 | N1 | place | village | bar | :n-outer |
248 | W2 | highway | primary | bar | :w-WE |
249 | W3 | highway | residential | foo | :w-NS |
251 | osm | class | type | addr_place | geometry |
252 | W1 | building | yes | bar | :w-building |
255 | object | parent_place_id |
258 Scenario: Building in associated street relation
259 Given the scene building-on-street-corner
261 | osm | class | type | geometry |
262 | W1 | building | yes | :w-building |
264 | osm | class | type | name | geometry |
265 | W2 | highway | primary | bar | :w-WE |
266 | W3 | highway | residential | foo | :w-NS |
268 | id | members | tags+type |
269 | 1 | W1:house,W2:street | associatedStreet |
272 | object | parent_place_id |
275 Scenario: Building in associated street relation overrides addr:street
276 Given the scene building-on-street-corner
278 | osm | class | type | street | geometry |
279 | W1 | building | yes | foo | :w-building |
281 | osm | class | type | name | geometry |
282 | W2 | highway | primary | bar | :w-WE |
283 | W3 | highway | residential | foo | :w-NS |
285 | id | members | tags+type |
286 | 1 | W1:house,W2:street | associatedStreet |
289 | object | parent_place_id |
292 Scenario: Wrong member in associated street relation is ignored
293 Given the scene building-on-street-corner
295 | osm | class | type | geometry |
296 | N1 | place | house | :n-outer |
298 | osm | class | type | street | geometry |
299 | W1 | building | yes | foo | :w-building |
301 | osm | class | type | name | geometry |
302 | W2 | highway | primary | bar | :w-WE |
303 | W3 | highway | residential | foo | :w-NS |
305 | id | members | tags+type |
306 | 1 | N1:house,W1:street,W3:street | associatedStreet |
309 | object | parent_place_id |
312 Scenario: POIs in building inherit address
313 Given the scene building-on-street-corner
315 | osm | class | type | geometry |
316 | N1 | amenity | bank | :n-inner |
317 | N2 | shop | bakery | :n-edge-NS |
318 | N3 | shop | supermarket| :n-edge-WE |
320 | osm | class | type | street | addr_place | housenr | geometry |
321 | W1 | building | yes | foo | nowhere | 3 | :w-building |
323 | osm | class | type | name | geometry |
324 | W2 | highway | primary | bar | :w-WE |
325 | W3 | highway | residential | foo | :w-NS |
328 | object | parent_place_id | street | addr_place | housenumber |
329 | W1 | W3 | foo | nowhere | 3 |
330 | N1 | W3 | foo | nowhere | 3 |
331 | N2 | W3 | foo | nowhere | 3 |
332 | N3 | W3 | foo | nowhere | 3 |
334 Scenario: POIs don't inherit from streets
335 Given the scene building-on-street-corner
337 | osm | class | type | geometry |
338 | N1 | amenity | bank | :n-inner |
340 | osm | class | type | street | addr_place | housenr | geometry |
341 | W1 | highway | path | foo | nowhere | 3 | :w-building |
343 | osm | class | type | name | geometry |
344 | W3 | highway | residential | foo | :w-NS |
347 | object | parent_place_id | street | addr_place | housenumber |
348 | N1 | W3 | None | None | None |
350 Scenario: POIs with own address do not inherit building address
351 Given the scene building-on-street-corner
353 | osm | class | type | street | geometry |
354 | N1 | amenity | bank | bar | :n-inner |
356 | osm | class | type | housenr | geometry |
357 | N2 | shop | bakery | 4 | :n-edge-NS |
359 | osm | class | type | addr_place | geometry |
360 | N3 | shop | supermarket| nowhere | :n-edge-WE |
362 | osm | class | type | name | geometry |
363 | N4 | place | isolated_dwelling | theplace | :n-outer |
365 | osm | class | type | addr_place | housenr | geometry |
366 | W1 | building | yes | theplace | 3 | :w-building |
368 | osm | class | type | name | geometry |
369 | W2 | highway | primary | bar | :w-WE |
370 | W3 | highway | residential | foo | :w-NS |
373 | object | parent_place_id | street | addr_place | housenumber |
374 | W1 | N4 | None | theplace | 3 |
375 | N1 | W2 | bar | None | None |
376 | N2 | W3 | None | None | 4 |
377 | N3 | W2 | None | nowhere | None |
379 Scenario: POIs parent a road if they are attached to it
380 Given the scene points-on-roads
382 | osm | class | type | street | geometry |
383 | N1 | highway | bus_stop | North St | :n-SE |
384 | N2 | highway | bus_stop | South St | :n-NW |
385 | N3 | highway | bus_stop | North St | :n-S-unglued |
386 | N4 | highway | bus_stop | South St | :n-N-unglued |
388 | osm | class | type | name | geometry |
389 | W1 | highway | secondary | North St | :w-north |
390 | W2 | highway | unclassified | South St | :w-south |
393 | 1 | 100,101,2,103,104 |
394 | 2 | 200,201,1,202,203 |
397 | object | parent_place_id |
403 Scenario: POIs do not parent non-roads they are attached to
404 Given the scene points-on-roads
406 | osm | class | type | street | geometry |
407 | N1 | highway | bus_stop | North St | :n-SE |
408 | N2 | highway | bus_stop | South St | :n-NW |
410 | osm | class | type | name | geometry |
411 | W1 | landuse | residential | North St | :w-north |
412 | W2 | waterway| river | South St | :w-south |
415 | 1 | 100,101,2,103,104 |
416 | 2 | 200,201,1,202,203 |
419 | object | parent_place_id |
423 Scenario: POIs on building outlines inherit associated street relation
424 Given the scene building-on-street-corner
426 | osm | class | type | geometry |
427 | N1 | place | house | :n-edge-NS |
428 | W1 | building | yes | :w-building |
430 | osm | class | type | name | geometry |
431 | W2 | highway | primary | bar | :w-WE |
432 | W3 | highway | residential | foo | :w-NS |
434 | id | members | tags+type |
435 | 1 | W1:house,W2:street | associatedStreet |
438 | 1 | 100,1,101,102,100 |
441 | object | parent_place_id |