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 grid with origin DE
11 | osm | class | type | housenr |
12 | N1 | place | house | 4 |
14 | osm | class | type | housenr | postcode |
15 | N2 | place | house | 5 | 99999 |
17 | osm | class | type | name | postcode | geometry |
18 | W1 | highway | residential | galoo | 12345 | 10,11 |
21 | object | parent_place_id |
24 When sending search query "4 galoo"
26 | ID | osm_type | osm_id | display_name |
27 | 0 | N | 1 | 4, galoo, 12345, Deutschland |
28 When sending search query "5 galoo"
30 | ID | osm_type | osm_id | display_name |
31 | 0 | N | 2 | 5, galoo, 99999, Deutschland |
33 Scenario: Address without tags, closest street
40 | osm | class | type |
41 | N1 | place | house |
42 | N2 | place | house |
43 | N3 | place | house |
44 | N4 | place | house |
46 | osm | class | type | geometry |
47 | W1 | highway | residential | 10,11 |
48 | W2 | highway | residential | 20,21 |
51 | object | parent_place_id |
57 Scenario: Address without tags avoids unnamed streets
64 | osm | class | type |
65 | N1 | place | house |
66 | N2 | place | house |
67 | N3 | place | house |
68 | N4 | place | house |
70 | osm | class | type | geometry |
71 | W1 | highway | residential | 10,11 |
73 | osm | class | type | geometry |
74 | W2 | highway | residential | 20,21 |
77 | object | parent_place_id |
83 Scenario: addr:street tag parents to appropriately named street
90 | osm | class | type | street|
91 | N1 | place | house | south |
92 | N2 | place | house | north |
93 | N3 | place | house | south |
94 | N4 | place | house | north |
96 | osm | class | type | name | geometry |
97 | W1 | highway | residential | north | 10,11 |
98 | W2 | highway | residential | south | 20,21 |
101 | object | parent_place_id |
108 Scenario: addr:street tag parents to appropriately named street, locale names
115 | osm | class | type | street| addr+street:de |
116 | N1 | place | house | south | Süd |
117 | N2 | place | house | north | Nord |
118 | N3 | place | house | south | Süd |
119 | N4 | place | house | north | Nord |
121 | osm | class | type | name | geometry |
122 | W1 | highway | residential | Nord | 10,11 |
123 | W2 | highway | residential | Süd | 20,21 |
126 | object | parent_place_id |
132 Scenario: addr:street tag parents to appropriately named street with abbreviation
139 | osm | class | type | street |
140 | N1 | place | house | south st |
141 | N2 | place | house | north st |
142 | N3 | place | house | south st |
143 | N4 | place | house | north st |
145 | osm | class | type | name+name:en | geometry |
146 | W1 | highway | residential | north street | 10,11 |
147 | W2 | highway | residential | south street | 20,21 |
150 | object | parent_place_id |
156 Scenario: addr:street tag parents to next named street
163 | osm | class | type | street |
164 | N1 | place | house | abcdef |
165 | N2 | place | house | abcdef |
166 | N3 | place | house | abcdef |
167 | N4 | place | house | abcdef |
169 | osm | class | type | name | geometry |
170 | W1 | highway | residential | abcdef | 10,11 |
171 | W2 | highway | residential | abcdef | 20,21 |
174 | object | parent_place_id |
180 Scenario: addr:street tag without appropriately named street
187 | osm | class | type | street |
188 | N1 | place | house | abcdef |
189 | N3 | place | house | abcdef |
191 | osm | class | type | name | geometry |
192 | W1 | highway | residential | abcde | 10,11 |
193 | W2 | highway | residential | abcde | 20,21 |
196 | object | parent_place_id |
200 Scenario: addr:place address
206 | osm | class | type | addr_place |
207 | N1 | place | house | myhamlet |
209 | osm | class | type | name | geometry |
210 | N2 | place | hamlet | myhamlet | 2 |
211 | W1 | highway | residential | myhamlet | 10,11 |
214 | object | parent_place_id |
217 Scenario: addr:street is preferred over addr:place
223 | osm | class | type | addr_place | street |
224 | N1 | place | house | myhamlet | mystreet|
226 | osm | class | type | name | geometry |
227 | N2 | place | hamlet | myhamlet | 2 |
228 | W1 | highway | residential | mystreet | 10,11 |
231 | object | parent_place_id |
234 Scenario: Untagged address in simple associated street relation
241 | osm | class | type |
242 | N1 | place | house |
243 | N2 | place | house |
244 | N3 | place | house |
246 | osm | class | type | name | geometry |
247 | W1 | highway | residential | foo | 10,11 |
248 | W2 | highway | service | bar | 10,12 |
250 | id | members | tags+type |
251 | 1 | W1:street,N1,N2,N3 | associatedStreet |
254 | object | parent_place_id |
259 Scenario: Avoid unnamed streets in simple associated street relation
266 | osm | class | type |
267 | N1 | place | house |
268 | N2 | place | house |
269 | N3 | place | house |
271 | osm | class | type | geometry |
272 | W2 | highway | residential | 10,12 |
274 | osm | class | type | geometry |
275 | W1 | highway | residential | 10,11 |
277 | id | members | tags+type |
278 | 1 | N1,N2,N3,W2:street,W1:street | associatedStreet |
281 | object | parent_place_id |
286 Scenario: Associated street relation overrides addr:street
293 | osm | class | type | street |
294 | N1 | place | house | bar |
296 | osm | class | type | name | geometry |
297 | W1 | highway | residential | foo | 10,11 |
298 | W2 | highway | residential | bar | 20,21 |
300 | id | members | tags+type |
301 | 1 | W1:street,N1 | associatedStreet |
304 | object | parent_place_id |
307 Scenario: Building without tags, closest street from center point
313 | osm | class | type | geometry |
314 | W1 | building | yes | (1,2,3,4,1) |
315 | W2 | highway | primary | 10,11 |
316 | W3 | highway | residential | 10,12 |
319 | object | parent_place_id |
322 Scenario: Building with addr:street tags
328 | osm | class | type | street | geometry |
329 | W1 | building | yes | foo | (1,2,3,4,1) |
331 | osm | class | type | name | geometry |
332 | W2 | highway | primary | bar | 10,11 |
333 | W3 | highway | residential | foo | 10,12 |
336 | object | parent_place_id |
339 Scenario: Building with addr:place tags
345 | osm | class | type | name | geometry |
346 | N9 | place | village | bar | 9 |
347 | W2 | highway | primary | bar | 10,11 |
349 | osm | class | type | addr_place | geometry |
350 | W1 | building | yes | bar | (1,2,3,4,1) |
353 | object | parent_place_id |
356 Scenario: Building in associated street relation
362 | osm | class | type | geometry |
363 | W1 | building | yes | (1,2,3,4,1) |
365 | osm | class | type | name | geometry |
366 | W2 | highway | primary | bar | 10,11 |
367 | W3 | highway | residential | foo | 10,12 |
369 | id | members | tags+type |
370 | 1 | W1:house,W3:street | associatedStreet |
373 | object | parent_place_id |
376 Scenario: Building in associated street relation overrides addr:street
382 | osm | class | type | street | geometry |
383 | W1 | building | yes | foo | (1,2,3,4,1) |
385 | osm | class | type | name | geometry |
386 | W2 | highway | primary | bar | 10,11 |
387 | W3 | highway | residential | foo | 10,12 |
389 | id | members | tags+type |
390 | 1 | W1:house,W2:street | associatedStreet |
393 | object | parent_place_id |
396 Scenario: Wrong member in associated street relation is ignored
398 | 10 | | | | | | | 11 |
399 | | 1 | | 3 | 4 | | | |
400 | | | | 6 | 5 | | | |
402 | osm | class | type | geometry |
403 | N1 | place | house | 11 |
405 | osm | class | type | street | geometry |
406 | W1 | building | yes | foo | (3,4,5,6,3) |
408 | osm | class | type | name | geometry |
409 | W3 | highway | residential | foo | 10,11 |
411 | id | members | tags+type |
412 | 1 | N1:house,W1:street,W3:street | associatedStreet |
415 | object | parent_place_id |
418 Scenario: street member in associatedStreet relation can be a relation
426 | osm | class | type | housenr | geometry |
427 | N9 | place | house | 34 | 9 |
429 | osm | class | type | name | geometry |
430 | R14 | highway | pedestrian | Right St | (1,2,4,3,1) |
431 | W14 | highway | pedestrian | Left St | 5,6 |
433 | id | members | tags+type |
434 | 1 | N9:house,R14:street | associatedStreet |
437 | object | parent_place_id |
441 Scenario: Choose closest street in associatedStreet relation
446 | osm | class | type | housenr | geometry |
447 | N1 | place | house | 1 | 1 |
448 | N3 | place | house | 3 | 3 |
450 | osm | class | type | geometry |
451 | W100 | highway | residential | 10,11 |
452 | W101 | highway | residential | 11,12 |
454 | id | members | tags+type |
455 | 1 | N1:house,N3:house,W100:street,W101:street | associatedStreet |
458 | object | parent_place_id |
463 Scenario: POIs in building inherit address
465 | 10 | | | | | | 11 |
466 | | | 5 | 2 | 6 | | |
468 | 12 | | 8 | | 7 | | |
470 | osm | class | type |
471 | N1 | amenity | bank |
472 | N2 | shop | bakery |
473 | N3 | shop | supermarket|
475 | osm | class | type | street | housenr | geometry |
476 | W1 | building | yes | foo | 3 | (5,6,7,8,5) |
478 | osm | class | type | name | geometry |
479 | W2 | highway | primary | bar | 10,11 |
480 | W3 | highway | residential | foo | 10,12 |
483 | object | parent_place_id | housenumber |
488 When sending geocodejson search query "3, foo" with address
493 Scenario: POIs don't inherit from streets
499 | osm | class | type |
500 | N1 | amenity | bank |
502 | osm | class | type | name | street | housenr | geometry |
503 | W1 | highway | path | bar | foo | 3 | (5,6,7,8,5) |
505 | osm | class | type | name | geometry |
506 | W3 | highway | residential | foo | 10,11 |
509 | object | parent_place_id | housenumber |
512 Scenario: POIs with own address do not inherit building address
514 | 10 | | | | | | 11 |
515 | | | 6 | 2 | 7 | | |
516 | | | 3 | 1 | | 5 | 4 |
517 | 12 | | 9 | | 8 | | |
519 | osm | class | type | street |
520 | N1 | amenity | bank | bar |
522 | osm | class | type | housenr |
523 | N2 | shop | bakery | 4 |
525 | osm | class | type | addr_place |
526 | N3 | shop | supermarket| nowhere |
528 | osm | class | type | name |
529 | N4 | place | isolated_dwelling | theplace |
530 | N5 | place | isolated_dwelling | nowhere |
532 | osm | class | type | addr_place | housenr | geometry |
533 | W1 | building | yes | theplace | 3 | (6,7,8,9,6) |
535 | osm | class | type | name | geometry |
536 | W2 | highway | primary | bar | 10,11 |
537 | W3 | highway | residential | foo | 10,12 |
540 | object | parent_place_id | housenumber |
546 Scenario: POIs parent a road if they are attached to it
552 | osm | class | type |
553 | N1 | highway | bus_stop |
555 | osm | class | type | name | geometry |
556 | W1 | highway | secondary | North St | 10,11 |
557 | W2 | highway | unclassified | South St | 20,1,21 |
564 | object | parent_place_id |
567 Scenario: POIs do not parent non-roads they are attached to
569 | 10 | | 1 | | 11 | | 30 |
570 | 14 | | | | 15 | | |
571 | 13 | | 2 | | 12 | | 31 |
573 | osm | class | type | street |
574 | N1 | highway | bus_stop | North St |
575 | N2 | highway | bus_stop | South St |
577 | osm | class | type | name | geometry |
578 | W1 | landuse | residential | North St | (14,15,12,2,13,14) |
579 | W2 | waterway| river | South St | 10,1,11 |
580 | W3 | highway | residential | foo | 30,31 |
583 | 1 | 10,11,12,2,13,10 |
587 | object | parent_place_id |
591 Scenario: POIs on building outlines inherit associated street relation
597 | osm | class | type | geometry |
598 | N1 | place | house | 1 |
599 | W1 | building | yes | (5,1,6,7,8,5)|
601 | osm | class | type | name | geometry |
602 | W2 | highway | primary | bar | 10,11 |
603 | W3 | highway | residential | foo | 10,12 |
605 | id | members | tags+type |
606 | 1 | W1:house,W3:street | associatedStreet |
612 | object | parent_place_id |
616 Scenario: Full names should be preferably matched for nearest road
623 | osm | class | type | name+name | geometry |
624 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
625 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
626 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
628 | osm | class | type | addr+street |
629 | N10 | shop | yes | Via Cavassico superiore |
632 | object | parent_place_id |
635 Scenario: place=square may be parented via addr:place
641 | osm | class | type | name+name | geometry |
642 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
644 | osm | class | type | name+name | housenr | addr_place | geometry |
645 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
648 | object | rank_address |
651 | object | parent_place_id |