1 Feature: Parenting of objects
2 Tests that the correct parent is chosen
4 Scenario: Address inherits postcode from its street unless it has a postcode
5 Given the grid with origin DE
10 | osm | class | type | housenr |
11 | N1 | place | house | 4 |
13 | osm | class | type | housenr | postcode |
14 | N2 | place | house | 5 | 99999 |
16 | osm | class | type | name | postcode | geometry |
17 | W1 | highway | residential | galoo | 12345 | 10,11 |
20 | object | parent_place_id |
23 When geocoding "4 galoo"
24 Then result 0 contains
25 | object | display_name |
26 | N1 | 4, galoo, 12345, Deutschland |
27 When geocoding "5 galoo"
28 Then result 0 contains
29 | object | display_name |
30 | N2 | 5, galoo, 99999, Deutschland |
32 Scenario: Address without tags, closest street
39 | osm | class | type |
40 | N1 | place | house |
41 | N2 | place | house |
42 | N3 | place | house |
43 | N4 | place | house |
45 | osm | class | type | geometry |
46 | W1 | highway | residential | 10,11 |
47 | W2 | highway | residential | 20,21 |
50 | object | parent_place_id |
56 Scenario: Address without tags avoids unnamed streets
63 | osm | class | type |
64 | N1 | place | house |
65 | N2 | place | house |
66 | N3 | place | house |
67 | N4 | place | house |
69 | osm | class | type | geometry |
70 | W1 | highway | residential | 10,11 |
72 | osm | class | type | geometry |
73 | W2 | highway | residential | 20,21 |
76 | object | parent_place_id |
82 Scenario: addr:street tag parents to appropriately named street
89 | osm | class | type | street|
90 | N1 | place | house | south |
91 | N2 | place | house | north |
92 | N3 | place | house | south |
93 | N4 | place | house | north |
95 | osm | class | type | name | geometry |
96 | W1 | highway | residential | north | 10,11 |
97 | W2 | highway | residential | south | 20,21 |
100 | object | parent_place_id |
106 Scenario: addr:street tag parents to appropriately named street, locale names
113 | osm | class | type | street| addr+street:de |
114 | N1 | place | house | south | Süd |
115 | N2 | place | house | north | Nord |
116 | N3 | place | house | south | Süd |
117 | N4 | place | house | north | Nord |
119 | osm | class | type | name | geometry |
120 | W1 | highway | residential | Nord | 10,11 |
121 | W2 | highway | residential | Süd | 20,21 |
124 | object | parent_place_id |
130 Scenario: addr:street tag parents to appropriately named street with abbreviation
137 | osm | class | type | street |
138 | N1 | place | house | south st |
139 | N2 | place | house | north st |
140 | N3 | place | house | south st |
141 | N4 | place | house | north st |
143 | osm | class | type | name+name:en | geometry |
144 | W1 | highway | residential | north street | 10,11 |
145 | W2 | highway | residential | south street | 20,21 |
148 | object | parent_place_id |
154 Scenario: addr:street tag parents to next named street
161 | osm | class | type | street |
162 | N1 | place | house | abcdef |
163 | N2 | place | house | abcdef |
164 | N3 | place | house | abcdef |
165 | N4 | place | house | abcdef |
167 | osm | class | type | name | geometry |
168 | W1 | highway | residential | abcdef | 10,11 |
169 | W2 | highway | residential | abcdef | 20,21 |
172 | object | parent_place_id |
178 Scenario: addr:street tag without appropriately named street
185 | osm | class | type | street |
186 | N1 | place | house | abcdef |
187 | N3 | place | house | abcdef |
189 | osm | class | type | name | geometry |
190 | W1 | highway | residential | abcde | 10,11 |
191 | W2 | highway | residential | abcde | 20,21 |
194 | object | parent_place_id |
198 Scenario: addr:place address
204 | osm | class | type | addr_place |
205 | N1 | place | house | myhamlet |
207 | osm | class | type | name | geometry |
208 | N2 | place | hamlet | myhamlet | 2 |
209 | W1 | highway | residential | myhamlet | 10,11 |
212 | object | parent_place_id |
215 Scenario: addr:street is preferred over addr:place
221 | osm | class | type | addr_place | street |
222 | N1 | place | house | myhamlet | mystreet|
224 | osm | class | type | name | geometry |
225 | N2 | place | hamlet | myhamlet | 2 |
226 | W1 | highway | residential | mystreet | 10,11 |
229 | object | parent_place_id |
232 Scenario: Untagged address in simple associated street relation
239 | osm | class | type |
240 | N1 | place | house |
241 | N2 | place | house |
242 | N3 | place | house |
244 | osm | class | type | name | geometry |
245 | W1 | highway | residential | foo | 10,11 |
246 | W2 | highway | service | bar | 10,12 |
248 | id | members | tags+type |
249 | 1 | W1:street,N1,N2,N3 | associatedStreet |
252 | object | parent_place_id |
257 Scenario: Avoid unnamed streets in simple associated street relation
264 | osm | class | type |
265 | N1 | place | house |
266 | N2 | place | house |
267 | N3 | place | house |
269 | osm | class | type | geometry |
270 | W2 | highway | residential | 10,12 |
272 | osm | class | type | geometry |
273 | W1 | highway | residential | 10,11 |
275 | id | members | tags+type |
276 | 1 | N1,N2,N3,W2:street,W1:street | associatedStreet |
279 | object | parent_place_id |
284 Scenario: Associated street relation overrides addr:street
291 | osm | class | type | street |
292 | N1 | place | house | bar |
294 | osm | class | type | name | geometry |
295 | W1 | highway | residential | foo | 10,11 |
296 | W2 | highway | residential | bar | 20,21 |
298 | id | members | tags+type |
299 | 1 | W1:street,N1 | associatedStreet |
302 | object | parent_place_id |
305 Scenario: Building without tags, closest street from center point
311 | osm | class | type | geometry |
312 | W1 | building | yes | (1,2,3,4,1) |
313 | W2 | highway | primary | 10,11 |
314 | W3 | highway | residential | 10,12 |
317 | object | parent_place_id |
320 Scenario: Building with addr:street tags
326 | osm | class | type | street | geometry |
327 | W1 | building | yes | foo | (1,2,3,4,1) |
329 | osm | class | type | name | geometry |
330 | W2 | highway | primary | bar | 10,11 |
331 | W3 | highway | residential | foo | 10,12 |
334 | object | parent_place_id |
337 Scenario: Building with addr:place tags
343 | osm | class | type | name | geometry |
344 | N9 | place | village | bar | 9 |
345 | W2 | highway | primary | bar | 10,11 |
347 | osm | class | type | addr_place | geometry |
348 | W1 | building | yes | bar | (1,2,3,4,1) |
351 | object | parent_place_id |
354 Scenario: Building in associated street relation
360 | osm | class | type | geometry |
361 | W1 | building | yes | (1,2,3,4,1) |
363 | osm | class | type | name | geometry |
364 | W2 | highway | primary | bar | 10,11 |
365 | W3 | highway | residential | foo | 10,12 |
367 | id | members | tags+type |
368 | 1 | W1:house,W3:street | associatedStreet |
371 | object | parent_place_id |
374 Scenario: Building in associated street relation overrides addr:street
380 | osm | class | type | street | geometry |
381 | W1 | building | yes | foo | (1,2,3,4,1) |
383 | osm | class | type | name | geometry |
384 | W2 | highway | primary | bar | 10,11 |
385 | W3 | highway | residential | foo | 10,12 |
387 | id | members | tags+type |
388 | 1 | W1:house,W2:street | associatedStreet |
391 | object | parent_place_id |
394 Scenario: Wrong member in associated street relation is ignored
396 | 10 | | | | | | | 11 |
397 | | 1 | | 3 | 4 | | | |
398 | | | | 6 | 5 | | | |
400 | osm | class | type | geometry |
401 | N1 | place | house | 11 |
403 | osm | class | type | street | geometry |
404 | W1 | building | yes | foo | (3,4,5,6,3) |
406 | osm | class | type | name | geometry |
407 | W3 | highway | residential | foo | 10,11 |
409 | id | members | tags+type |
410 | 1 | N1:house,W1:street,W3:street | associatedStreet |
413 | object | parent_place_id |
416 Scenario: street member in associatedStreet relation can be a relation
424 | osm | class | type | housenr | geometry |
425 | N9 | place | house | 34 | 9 |
427 | osm | class | type | name | geometry |
428 | R14 | highway | pedestrian | Right St | (1,2,4,3,1) |
429 | W14 | highway | pedestrian | Left St | 5,6 |
431 | id | members | tags+type |
432 | 1 | N9:house,R14:street | associatedStreet |
435 | object | parent_place_id |
439 Scenario: Choose closest street in associatedStreet relation
444 | osm | class | type | housenr | geometry |
445 | N1 | place | house | 1 | 1 |
446 | N3 | place | house | 3 | 3 |
448 | osm | class | type | geometry |
449 | W100 | highway | residential | 10,11 |
450 | W101 | highway | residential | 11,12 |
452 | id | members | tags+type |
453 | 1 | N1:house,N3:house,W100:street,W101:street | associatedStreet |
456 | object | parent_place_id |
461 Scenario: POIs in building inherit address
463 | 10 | | | | | | 11 |
464 | | | 5 | 2 | 6 | | |
466 | 12 | | 8 | | 7 | | |
468 | osm | class | type |
469 | N1 | amenity | bank |
470 | N2 | shop | bakery |
471 | N3 | shop | supermarket|
473 | osm | class | type | street | housenr | geometry |
474 | W1 | building | yes | foo | 3 | (5,6,7,8,5) |
476 | osm | class | type | name | geometry |
477 | W2 | highway | primary | bar | 10,11 |
478 | W3 | highway | residential | foo | 10,12 |
481 | object | parent_place_id | housenumber |
486 When geocoding "3, foo"
487 Then the result set contains
488 | address+house_number |
491 Scenario: POIs don't inherit from streets
497 | osm | class | type |
498 | N1 | amenity | bank |
500 | osm | class | type | name | street | housenr | geometry |
501 | W1 | highway | path | bar | foo | 3 | (5,6,7,8,5) |
503 | osm | class | type | name | geometry |
504 | W3 | highway | residential | foo | 10,11 |
507 | object | parent_place_id | housenumber |
510 Scenario: POIs with own address do not inherit building address
512 | 10 | | | | | | 11 |
513 | | | 6 | 2 | 7 | | |
514 | | | 3 | 1 | | 5 | 4 |
515 | 12 | | 9 | | 8 | | |
517 | osm | class | type | street |
518 | N1 | amenity | bank | bar |
520 | osm | class | type | housenr |
521 | N2 | shop | bakery | 4 |
523 | osm | class | type | addr_place |
524 | N3 | shop | supermarket| nowhere |
526 | osm | class | type | name |
527 | N4 | place | isolated_dwelling | theplace |
528 | N5 | place | isolated_dwelling | nowhere |
530 | osm | class | type | addr_place | housenr | geometry |
531 | W1 | building | yes | theplace | 3 | (6,7,8,9,6) |
533 | osm | class | type | name | geometry |
534 | W2 | highway | primary | bar | 10,11 |
535 | W3 | highway | residential | foo | 10,12 |
538 | object | parent_place_id | housenumber |
544 Scenario: POIs parent a road if they are attached to it
550 | osm | class | type |
551 | N1 | highway | bus_stop |
553 | osm | class | type | name | geometry |
554 | W1 | highway | secondary | North St | 10,11 |
555 | W2 | highway | unclassified | South St | 20,1,21 |
562 | object | parent_place_id |
565 Scenario: POIs do not parent non-roads they are attached to
567 | 10 | | 1 | | 11 | | 30 |
568 | 14 | | | | 15 | | |
569 | 13 | | 2 | | 12 | | 31 |
571 | osm | class | type | street |
572 | N1 | highway | bus_stop | North St |
573 | N2 | highway | bus_stop | South St |
575 | osm | class | type | name | geometry |
576 | W1 | landuse | residential | North St | (14,15,12,2,13,14) |
577 | W2 | waterway| river | South St | 10,1,11 |
578 | W3 | highway | residential | foo | 30,31 |
581 | 1 | 10,11,12,2,13,10 |
585 | object | parent_place_id |
589 Scenario: POIs on building outlines inherit associated street relation
595 | osm | class | type | geometry |
596 | N1 | place | house | 1 |
597 | W1 | building | yes | (5,1,6,7,8,5)|
599 | osm | class | type | name | geometry |
600 | W2 | highway | primary | bar | 10,11 |
601 | W3 | highway | residential | foo | 10,12 |
603 | id | members | tags+type |
604 | 1 | W1:house,W3:street | associatedStreet |
610 | object | parent_place_id |
614 Scenario: Full names should be preferably matched for nearest road
621 | osm | class | type | name+name | geometry |
622 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
623 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
624 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
626 | osm | class | type | addr+street |
627 | N10 | shop | yes | Via Cavassico superiore |
630 | object | parent_place_id |
633 Scenario: place=square may be parented via addr:place
639 | osm | class | type | name+name | geometry |
640 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
642 | osm | class | type | name+name | housenr | addr_place | geometry |
643 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
646 | object | rank_address |
649 | object | parent_place_id |