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 appropriately named street with abbreviation
115 Given the scene roads-with-pois
117 | osm | class | type | street| geometry |
118 | N1 | place | house | south st | :p-N1 |
119 | N2 | place | house | north st | :p-N2 |
120 | N3 | place | house | south st | :p-S1 |
121 | N4 | place | house | north st | :p-S2 |
123 | osm | class | type | name+name:en | geometry |
124 | W1 | highway | residential | north street | :w-north |
125 | W2 | highway | residential | south street | :w-south |
128 | object | parent_place_id |
136 Scenario: addr:street tag parents to next named street
137 Given the scene roads-with-pois
139 | osm | class | type | street | geometry |
140 | N1 | place | house | abcdef | :p-N1 |
141 | N2 | place | house | abcdef | :p-N2 |
142 | N3 | place | house | abcdef | :p-S1 |
143 | N4 | place | house | abcdef | :p-S2 |
145 | osm | class | type | name | geometry |
146 | W1 | highway | residential | abcdef | :w-north |
147 | W2 | highway | residential | abcdef | :w-south |
150 | object | parent_place_id |
156 Scenario: addr:street tag without appropriately named street
157 Given the scene roads-with-pois
159 | osm | class | type | street | geometry |
160 | N1 | place | house | abcdef | :p-N1 |
161 | N2 | place | house | abcdef | :p-N2 |
162 | N3 | place | house | abcdef | :p-S1 |
163 | N4 | place | house | abcdef | :p-S2 |
165 | osm | class | type | name | geometry |
166 | W1 | highway | residential | abcde | :w-north |
167 | W2 | highway | residential | abcde | :w-south |
170 | object | parent_place_id |
176 Scenario: addr:place address
177 Given the scene road-with-alley
179 | osm | class | type | addr_place | geometry |
180 | N1 | place | house | myhamlet | :n-alley |
182 | osm | class | type | name | geometry |
183 | N2 | place | hamlet | myhamlet | :n-main-west |
184 | W1 | highway | residential | myhamlet | :w-main |
187 | object | parent_place_id |
190 Scenario: addr:street is preferred over addr:place
191 Given the scene road-with-alley
193 | osm | class | type | addr_place | street | geometry |
194 | N1 | place | house | myhamlet | mystreet| :n-alley |
196 | osm | class | type | name | geometry |
197 | N2 | place | hamlet | myhamlet | :n-main-west |
198 | W1 | highway | residential | mystreet | :w-main |
201 | object | parent_place_id |
204 Scenario: Untagged address in simple associated street relation
205 Given the scene road-with-alley
207 | osm | class | type | geometry |
208 | N1 | place | house | :n-alley |
209 | N2 | place | house | :n-corner |
210 | N3 | place | house | :n-main-west |
212 | osm | class | type | name | geometry |
213 | W1 | highway | residential | foo | :w-main |
214 | W2 | highway | service | bar | :w-alley |
216 | id | members | tags+type |
217 | 1 | W1:street,N1,N2,N3 | associatedStreet |
220 | object | parent_place_id |
225 Scenario: Avoid unnamed streets in simple associated street relation
226 Given the scene road-with-alley
228 | osm | class | type | geometry |
229 | N1 | place | house | :n-alley |
230 | N2 | place | house | :n-corner |
231 | N3 | place | house | :n-main-west |
232 | W2 | highway | residential | :w-alley |
234 | osm | class | type | geometry |
235 | W1 | highway | residential | :w-main |
237 | id | members | tags+type |
238 | 1 | N1,N2,N3,W2:street,W1:street | associatedStreet |
241 | object | parent_place_id |
246 Scenario: Associated street relation overrides addr:street
247 Given the scene road-with-alley
249 | osm | class | type | street | geometry |
250 | N1 | place | house | bar | :n-alley |
252 | osm | class | type | name | geometry |
253 | W1 | highway | residential | foo | :w-main |
254 | W2 | highway | residential | bar | :w-alley |
256 | id | members | tags+type |
257 | 1 | W1:street,N1,N2,N3 | associatedStreet |
260 | object | parent_place_id |
263 Scenario: Building without tags, closest street from center point
264 Given the scene building-on-street-corner
266 | osm | class | type | geometry |
267 | W1 | building | yes | :w-building |
268 | W2 | highway | primary | :w-WE |
269 | W3 | highway | residential | :w-NS |
272 | object | parent_place_id |
275 Scenario: Building with addr:street tags
276 Given the scene building-on-street-corner
278 | osm | class | type | street | geometry |
279 | W1 | building | yes | bar | :w-building |
281 | osm | class | type | name | geometry |
282 | W2 | highway | primary | bar | :w-WE |
283 | W3 | highway | residential | foo | :w-NS |
286 | object | parent_place_id |
289 Scenario: Building with addr:place tags
290 Given the scene building-on-street-corner
292 | osm | class | type | name | geometry |
293 | N1 | place | village | bar | :n-outer |
294 | W2 | highway | primary | bar | :w-WE |
295 | W3 | highway | residential | foo | :w-NS |
297 | osm | class | type | addr_place | geometry |
298 | W1 | building | yes | bar | :w-building |
301 | object | parent_place_id |
304 Scenario: Building in associated street relation
305 Given the scene building-on-street-corner
307 | osm | class | type | geometry |
308 | W1 | building | yes | :w-building |
310 | osm | class | type | name | geometry |
311 | W2 | highway | primary | bar | :w-WE |
312 | W3 | highway | residential | foo | :w-NS |
314 | id | members | tags+type |
315 | 1 | W1:house,W2:street | associatedStreet |
318 | object | parent_place_id |
321 Scenario: Building in associated street relation overrides addr:street
322 Given the scene building-on-street-corner
324 | osm | class | type | street | geometry |
325 | W1 | building | yes | foo | :w-building |
327 | osm | class | type | name | geometry |
328 | W2 | highway | primary | bar | :w-WE |
329 | W3 | highway | residential | foo | :w-NS |
331 | id | members | tags+type |
332 | 1 | W1:house,W2:street | associatedStreet |
335 | object | parent_place_id |
338 Scenario: Wrong member in associated street relation is ignored
339 Given the scene building-on-street-corner
341 | osm | class | type | geometry |
342 | N1 | place | house | :n-outer |
344 | osm | class | type | street | geometry |
345 | W1 | building | yes | foo | :w-building |
347 | osm | class | type | name | geometry |
348 | W2 | highway | primary | bar | :w-WE |
349 | W3 | highway | residential | foo | :w-NS |
351 | id | members | tags+type |
352 | 1 | N1:house,W1:street,W3:street | associatedStreet |
355 | object | parent_place_id |
359 Scenario: street member in associatedStreet relation can be a relation
367 | osm | class | type | housenr | geometry |
368 | N9 | place | house | 34 | 9 |
370 | osm | class | type | name | geometry |
371 | R14 | highway | pedestrian | Right St | (1,2,4,3,1) |
372 | W14 | highway | pedestrian | Left St | 5,6 |
374 | id | members | tags+type |
375 | 1 | N9:house,R14:street | associatedStreet |
378 | object | parent_place_id |
381 Scenario: POIs in building inherit address
382 Given the scene building-on-street-corner
384 | osm | class | type | geometry |
385 | N1 | amenity | bank | :n-inner |
386 | N2 | shop | bakery | :n-edge-NS |
387 | N3 | shop | supermarket| :n-edge-WE |
389 | osm | class | type | street | addr_place | housenr | geometry |
390 | W1 | building | yes | foo | nowhere | 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 |
402 When sending geocodejson search query "3, foo" with address
407 Scenario: POIs don't inherit from streets
408 Given the scene building-on-street-corner
410 | osm | class | type | geometry |
411 | N1 | amenity | bank | :n-inner |
413 | osm | class | type | street | addr_place | housenr | geometry |
414 | W1 | highway | path | foo | nowhere | 3 | :w-building |
416 | osm | class | type | name | geometry |
417 | W3 | highway | residential | foo | :w-NS |
420 | object | parent_place_id | housenumber |
423 Scenario: POIs with own address do not inherit building address
424 Given the scene building-on-street-corner
426 | osm | class | type | street | geometry |
427 | N1 | amenity | bank | bar | :n-inner |
429 | osm | class | type | housenr | geometry |
430 | N2 | shop | bakery | 4 | :n-edge-NS |
432 | osm | class | type | addr_place | geometry |
433 | N3 | shop | supermarket| nowhere | :n-edge-WE |
435 | osm | class | type | name | geometry |
436 | N4 | place | isolated_dwelling | theplace | :n-outer |
438 | osm | class | type | addr_place | housenr | geometry |
439 | W1 | building | yes | theplace | 3 | :w-building |
441 | osm | class | type | name | geometry |
442 | W2 | highway | primary | bar | :w-WE |
443 | W3 | highway | residential | foo | :w-NS |
446 | object | parent_place_id | housenumber |
452 Scenario: POIs parent a road if they are attached to it
453 Given the scene points-on-roads
455 | osm | class | type | street | geometry |
456 | N1 | highway | bus_stop | North St | :n-SE |
457 | N2 | highway | bus_stop | South St | :n-NW |
458 | N3 | highway | bus_stop | North St | :n-S-unglued |
459 | N4 | highway | bus_stop | South St | :n-N-unglued |
461 | osm | class | type | name | geometry |
462 | W1 | highway | secondary | North St | :w-north |
463 | W2 | highway | unclassified | South St | :w-south |
466 | 1 | 100,101,2,103,104 |
467 | 2 | 200,201,1,202,203 |
470 | object | parent_place_id |
476 Scenario: POIs do not parent non-roads they are attached to
477 Given the scene points-on-roads
479 | osm | class | type | street | geometry |
480 | N1 | highway | bus_stop | North St | :n-SE |
481 | N2 | highway | bus_stop | South St | :n-NW |
483 | osm | class | type | name | geometry |
484 | W1 | landuse | residential | North St | :w-north |
485 | W2 | waterway| river | South St | :w-south |
488 | 1 | 100,101,2,103,104 |
489 | 2 | 200,201,1,202,203 |
492 | object | parent_place_id |
496 Scenario: POIs on building outlines inherit associated street relation
497 Given the scene building-on-street-corner
499 | osm | class | type | geometry |
500 | N1 | place | house | :n-edge-NS |
501 | W1 | building | yes | :w-building |
503 | osm | class | type | name | geometry |
504 | W2 | highway | primary | bar | :w-WE |
505 | W3 | highway | residential | foo | :w-NS |
507 | id | members | tags+type |
508 | 1 | W1:house,W2:street | associatedStreet |
511 | 1 | 100,1,101,102,100 |
514 | object | parent_place_id |
518 Scenario: Full names should be preferably matched for nearest road
525 | osm | class | type | name+name | geometry |
526 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
527 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
528 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
530 | osm | class | type | addr+street |
531 | N10 | shop | yes | Via Cavassico superiore |
534 | object | parent_place_id |
537 Scenario: place=square may be parented via addr:place
543 | osm | class | type | name+name | geometry |
544 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
546 | osm | class | type | name+name | housenr | addr_place | geometry |
547 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
550 | object | rank_address |
553 | object | parent_place_id |