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 sending search query "4 galoo"
23 | ID | osm_type | osm_id | display_name |
24 | 0 | N | 1 | 4, galoo, 12345 |
25 When sending search query "5 galoo"
27 | ID | osm_type | osm_id | display_name |
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 |
91 Scenario: addr:street tag parents to appropriately named street, locale names
92 Given the scene roads-with-pois
94 | osm | class | type | street| addr+street:de | geometry |
95 | N1 | place | house | south | Süd | :p-N1 |
96 | N2 | place | house | north | Nord | :p-N2 |
97 | N3 | place | house | south | Süd | :p-S1 |
98 | N4 | place | house | north | Nord | :p-S2 |
100 | osm | class | type | name | geometry |
101 | W1 | highway | residential | Nord | :w-north |
102 | W2 | highway | residential | Süd | :w-south |
104 | osm | class | type | name | name+name:old |
105 | N5 | place | hamlet | south | north |
108 | object | parent_place_id |
114 Scenario: addr:street tag parents to next named street
115 Given the scene roads-with-pois
117 | osm | class | type | street | geometry |
118 | N1 | place | house | abcdef | :p-N1 |
119 | N2 | place | house | abcdef | :p-N2 |
120 | N3 | place | house | abcdef | :p-S1 |
121 | N4 | place | house | abcdef | :p-S2 |
123 | osm | class | type | name | geometry |
124 | W1 | highway | residential | abcdef | :w-north |
125 | W2 | highway | residential | abcdef | :w-south |
128 | object | parent_place_id |
134 Scenario: addr:street tag without appropriately named street
135 Given the scene roads-with-pois
137 | osm | class | type | street | geometry |
138 | N1 | place | house | abcdef | :p-N1 |
139 | N2 | place | house | abcdef | :p-N2 |
140 | N3 | place | house | abcdef | :p-S1 |
141 | N4 | place | house | abcdef | :p-S2 |
143 | osm | class | type | name | geometry |
144 | W1 | highway | residential | abcde | :w-north |
145 | W2 | highway | residential | abcde | :w-south |
148 | object | parent_place_id |
154 Scenario: addr:place address
155 Given the scene road-with-alley
157 | osm | class | type | addr_place | geometry |
158 | N1 | place | house | myhamlet | :n-alley |
160 | osm | class | type | name | geometry |
161 | N2 | place | hamlet | myhamlet | :n-main-west |
162 | W1 | highway | residential | myhamlet | :w-main |
165 | object | parent_place_id |
168 Scenario: addr:street is preferred over addr:place
169 Given the scene road-with-alley
171 | osm | class | type | addr_place | street | geometry |
172 | N1 | place | house | myhamlet | mystreet| :n-alley |
174 | osm | class | type | name | geometry |
175 | N2 | place | hamlet | myhamlet | :n-main-west |
176 | W1 | highway | residential | mystreet | :w-main |
179 | object | parent_place_id |
182 Scenario: Untagged address in simple associated street relation
183 Given the scene road-with-alley
185 | osm | class | type | geometry |
186 | N1 | place | house | :n-alley |
187 | N2 | place | house | :n-corner |
188 | N3 | place | house | :n-main-west |
190 | osm | class | type | name | geometry |
191 | W1 | highway | residential | foo | :w-main |
192 | W2 | highway | service | bar | :w-alley |
194 | id | members | tags+type |
195 | 1 | W1:street,N1,N2,N3 | associatedStreet |
198 | object | parent_place_id |
203 Scenario: Avoid unnamed streets in simple associated street relation
204 Given the scene road-with-alley
206 | osm | class | type | geometry |
207 | N1 | place | house | :n-alley |
208 | N2 | place | house | :n-corner |
209 | N3 | place | house | :n-main-west |
210 | W2 | highway | residential | :w-alley |
212 | osm | class | type | geometry |
213 | W1 | highway | residential | :w-main |
215 | id | members | tags+type |
216 | 1 | N1,N2,N3,W2:street,W1:street | associatedStreet |
219 | object | parent_place_id |
224 Scenario: Associated street relation overrides addr:street
225 Given the scene road-with-alley
227 | osm | class | type | street | geometry |
228 | N1 | place | house | bar | :n-alley |
230 | osm | class | type | name | geometry |
231 | W1 | highway | residential | foo | :w-main |
232 | W2 | highway | residential | bar | :w-alley |
234 | id | members | tags+type |
235 | 1 | W1:street,N1,N2,N3 | associatedStreet |
238 | object | parent_place_id |
241 Scenario: Building without tags, closest street from center point
242 Given the scene building-on-street-corner
244 | osm | class | type | geometry |
245 | W1 | building | yes | :w-building |
246 | W2 | highway | primary | :w-WE |
247 | W3 | highway | residential | :w-NS |
250 | object | parent_place_id |
253 Scenario: Building with addr:street tags
254 Given the scene building-on-street-corner
256 | osm | class | type | street | geometry |
257 | W1 | building | yes | bar | :w-building |
259 | osm | class | type | name | geometry |
260 | W2 | highway | primary | bar | :w-WE |
261 | W3 | highway | residential | foo | :w-NS |
264 | object | parent_place_id |
267 Scenario: Building with addr:place tags
268 Given the scene building-on-street-corner
270 | osm | class | type | name | geometry |
271 | N1 | place | village | bar | :n-outer |
272 | W2 | highway | primary | bar | :w-WE |
273 | W3 | highway | residential | foo | :w-NS |
275 | osm | class | type | addr_place | geometry |
276 | W1 | building | yes | bar | :w-building |
279 | object | parent_place_id |
282 Scenario: Building in associated street relation
283 Given the scene building-on-street-corner
285 | osm | class | type | geometry |
286 | W1 | building | yes | :w-building |
288 | osm | class | type | name | geometry |
289 | W2 | highway | primary | bar | :w-WE |
290 | W3 | highway | residential | foo | :w-NS |
292 | id | members | tags+type |
293 | 1 | W1:house,W2:street | associatedStreet |
296 | object | parent_place_id |
299 Scenario: Building in associated street relation overrides addr:street
300 Given the scene building-on-street-corner
302 | osm | class | type | street | geometry |
303 | W1 | building | yes | foo | :w-building |
305 | osm | class | type | name | geometry |
306 | W2 | highway | primary | bar | :w-WE |
307 | W3 | highway | residential | foo | :w-NS |
309 | id | members | tags+type |
310 | 1 | W1:house,W2:street | associatedStreet |
313 | object | parent_place_id |
316 Scenario: Wrong member in associated street relation is ignored
317 Given the scene building-on-street-corner
319 | osm | class | type | geometry |
320 | N1 | place | house | :n-outer |
322 | osm | class | type | street | geometry |
323 | W1 | building | yes | foo | :w-building |
325 | osm | class | type | name | geometry |
326 | W2 | highway | primary | bar | :w-WE |
327 | W3 | highway | residential | foo | :w-NS |
329 | id | members | tags+type |
330 | 1 | N1:house,W1:street,W3:street | associatedStreet |
333 | object | parent_place_id |
336 Scenario: POIs in building inherit address
337 Given the scene building-on-street-corner
339 | osm | class | type | geometry |
340 | N1 | amenity | bank | :n-inner |
341 | N2 | shop | bakery | :n-edge-NS |
342 | N3 | shop | supermarket| :n-edge-WE |
344 | osm | class | type | street | addr_place | housenr | geometry |
345 | W1 | building | yes | foo | nowhere | 3 | :w-building |
347 | osm | class | type | name | geometry |
348 | W2 | highway | primary | bar | :w-WE |
349 | W3 | highway | residential | foo | :w-NS |
352 | object | parent_place_id | housenumber |
358 Scenario: POIs don't inherit from streets
359 Given the scene building-on-street-corner
361 | osm | class | type | geometry |
362 | N1 | amenity | bank | :n-inner |
364 | osm | class | type | street | addr_place | housenr | geometry |
365 | W1 | highway | path | foo | nowhere | 3 | :w-building |
367 | osm | class | type | name | geometry |
368 | W3 | highway | residential | foo | :w-NS |
371 | object | parent_place_id | housenumber |
374 Scenario: POIs with own address do not inherit building address
375 Given the scene building-on-street-corner
377 | osm | class | type | street | geometry |
378 | N1 | amenity | bank | bar | :n-inner |
380 | osm | class | type | housenr | geometry |
381 | N2 | shop | bakery | 4 | :n-edge-NS |
383 | osm | class | type | addr_place | geometry |
384 | N3 | shop | supermarket| nowhere | :n-edge-WE |
386 | osm | class | type | name | geometry |
387 | N4 | place | isolated_dwelling | theplace | :n-outer |
389 | osm | class | type | addr_place | housenr | geometry |
390 | W1 | building | yes | theplace | 3 | :w-building |
392 | osm | class | type | name | geometry |
393 | W2 | highway | primary | bar | :w-WE |
394 | W3 | highway | residential | foo | :w-NS |
397 | object | parent_place_id | housenumber |
403 Scenario: POIs parent a road if they are attached to it
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 |
409 | N3 | highway | bus_stop | North St | :n-S-unglued |
410 | N4 | highway | bus_stop | South St | :n-N-unglued |
412 | osm | class | type | name | geometry |
413 | W1 | highway | secondary | North St | :w-north |
414 | W2 | highway | unclassified | South St | :w-south |
417 | 1 | 100,101,2,103,104 |
418 | 2 | 200,201,1,202,203 |
421 | object | parent_place_id |
427 Scenario: POIs do not parent non-roads they are attached to
428 Given the scene points-on-roads
430 | osm | class | type | street | geometry |
431 | N1 | highway | bus_stop | North St | :n-SE |
432 | N2 | highway | bus_stop | South St | :n-NW |
434 | osm | class | type | name | geometry |
435 | W1 | landuse | residential | North St | :w-north |
436 | W2 | waterway| river | South St | :w-south |
439 | 1 | 100,101,2,103,104 |
440 | 2 | 200,201,1,202,203 |
443 | object | parent_place_id |
447 Scenario: POIs on building outlines inherit associated street relation
448 Given the scene building-on-street-corner
450 | osm | class | type | geometry |
451 | N1 | place | house | :n-edge-NS |
452 | W1 | building | yes | :w-building |
454 | osm | class | type | name | geometry |
455 | W2 | highway | primary | bar | :w-WE |
456 | W3 | highway | residential | foo | :w-NS |
458 | id | members | tags+type |
459 | 1 | W1:house,W2:street | associatedStreet |
462 | 1 | 100,1,101,102,100 |
465 | object | parent_place_id |
469 Scenario: Full names should be preferably matched for nearest road
476 | osm | class | type | name+name | geometry |
477 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
478 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
479 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
481 | osm | class | type | addr+street |
482 | N10 | shop | yes | Via Cavassico superiore |
485 | object | parent_place_id |
488 Scenario: place=square may be parented via addr:place
494 | osm | class | type | name+name | geometry |
495 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
497 | osm | class | type | name+name | housenr | addr_place | geometry |
498 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
501 | object | rank_address |
504 | object | parent_place_id |