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 |
440 Scenario: POIs in building inherit address
442 | 10 | | | | | | 11 |
443 | | | 5 | 2 | 6 | | |
445 | 12 | | 8 | | 7 | | |
447 | osm | class | type |
448 | N1 | amenity | bank |
449 | N2 | shop | bakery |
450 | N3 | shop | supermarket|
452 | osm | class | type | street | housenr | geometry |
453 | W1 | building | yes | foo | 3 | (5,6,7,8,5) |
455 | osm | class | type | name | geometry |
456 | W2 | highway | primary | bar | 10,11 |
457 | W3 | highway | residential | foo | 10,12 |
460 | object | parent_place_id | housenumber |
465 When sending geocodejson search query "3, foo" with address
470 Scenario: POIs don't inherit from streets
476 | osm | class | type |
477 | N1 | amenity | bank |
479 | osm | class | type | name | street | housenr | geometry |
480 | W1 | highway | path | bar | foo | 3 | (5,6,7,8,5) |
482 | osm | class | type | name | geometry |
483 | W3 | highway | residential | foo | 10,11 |
486 | object | parent_place_id | housenumber |
489 Scenario: POIs with own address do not inherit building address
491 | 10 | | | | | | 11 |
492 | | | 6 | 2 | 7 | | |
493 | | | 3 | 1 | | 5 | 4 |
494 | 12 | | 9 | | 8 | | |
496 | osm | class | type | street |
497 | N1 | amenity | bank | bar |
499 | osm | class | type | housenr |
500 | N2 | shop | bakery | 4 |
502 | osm | class | type | addr_place |
503 | N3 | shop | supermarket| nowhere |
505 | osm | class | type | name |
506 | N4 | place | isolated_dwelling | theplace |
507 | N5 | place | isolated_dwelling | nowhere |
509 | osm | class | type | addr_place | housenr | geometry |
510 | W1 | building | yes | theplace | 3 | (6,7,8,9,6) |
512 | osm | class | type | name | geometry |
513 | W2 | highway | primary | bar | 10,11 |
514 | W3 | highway | residential | foo | 10,12 |
517 | object | parent_place_id | housenumber |
523 Scenario: POIs parent a road if they are attached to it
529 | osm | class | type |
530 | N1 | highway | bus_stop |
532 | osm | class | type | name | geometry |
533 | W1 | highway | secondary | North St | 10,11 |
534 | W2 | highway | unclassified | South St | 20,1,21 |
541 | object | parent_place_id |
544 Scenario: POIs do not parent non-roads they are attached to
546 | 10 | | 1 | | 11 | | 30 |
547 | 14 | | | | 15 | | |
548 | 13 | | 2 | | 12 | | 31 |
550 | osm | class | type | street |
551 | N1 | highway | bus_stop | North St |
552 | N2 | highway | bus_stop | South St |
554 | osm | class | type | name | geometry |
555 | W1 | landuse | residential | North St | (14,15,12,2,13,14) |
556 | W2 | waterway| river | South St | 10,1,11 |
557 | W3 | highway | residential | foo | 30,31 |
560 | 1 | 10,11,12,2,13,10 |
564 | object | parent_place_id |
568 Scenario: POIs on building outlines inherit associated street relation
574 | osm | class | type | geometry |
575 | N1 | place | house | 1 |
576 | W1 | building | yes | (5,1,6,7,8,5)|
578 | osm | class | type | name | geometry |
579 | W2 | highway | primary | bar | 10,11 |
580 | W3 | highway | residential | foo | 10,12 |
582 | id | members | tags+type |
583 | 1 | W1:house,W3:street | associatedStreet |
589 | object | parent_place_id |
593 Scenario: Full names should be preferably matched for nearest road
600 | osm | class | type | name+name | geometry |
601 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
602 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
603 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
605 | osm | class | type | addr+street |
606 | N10 | shop | yes | Via Cavassico superiore |
609 | object | parent_place_id |
612 Scenario: place=square may be parented via addr:place
618 | osm | class | type | name+name | geometry |
619 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
621 | osm | class | type | name+name | housenr | addr_place | geometry |
622 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
625 | object | rank_address |
628 | object | parent_place_id |