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 |
358 Scenario: POIs in building inherit address
359 Given the scene building-on-street-corner
361 | osm | class | type | geometry |
362 | N1 | amenity | bank | :n-inner |
363 | N2 | shop | bakery | :n-edge-NS |
364 | N3 | shop | supermarket| :n-edge-WE |
366 | osm | class | type | street | addr_place | housenr | geometry |
367 | W1 | building | yes | foo | nowhere | 3 | :w-building |
369 | osm | class | type | name | geometry |
370 | W2 | highway | primary | bar | :w-WE |
371 | W3 | highway | residential | foo | :w-NS |
374 | object | parent_place_id | housenumber |
380 Scenario: POIs don't inherit from streets
381 Given the scene building-on-street-corner
383 | osm | class | type | geometry |
384 | N1 | amenity | bank | :n-inner |
386 | osm | class | type | street | addr_place | housenr | geometry |
387 | W1 | highway | path | foo | nowhere | 3 | :w-building |
389 | osm | class | type | name | geometry |
390 | W3 | highway | residential | foo | :w-NS |
393 | object | parent_place_id | housenumber |
396 Scenario: POIs with own address do not inherit building address
397 Given the scene building-on-street-corner
399 | osm | class | type | street | geometry |
400 | N1 | amenity | bank | bar | :n-inner |
402 | osm | class | type | housenr | geometry |
403 | N2 | shop | bakery | 4 | :n-edge-NS |
405 | osm | class | type | addr_place | geometry |
406 | N3 | shop | supermarket| nowhere | :n-edge-WE |
408 | osm | class | type | name | geometry |
409 | N4 | place | isolated_dwelling | theplace | :n-outer |
411 | osm | class | type | addr_place | housenr | geometry |
412 | W1 | building | yes | theplace | 3 | :w-building |
414 | osm | class | type | name | geometry |
415 | W2 | highway | primary | bar | :w-WE |
416 | W3 | highway | residential | foo | :w-NS |
419 | object | parent_place_id | housenumber |
425 Scenario: POIs parent a road if they are attached to it
426 Given the scene points-on-roads
428 | osm | class | type | street | geometry |
429 | N1 | highway | bus_stop | North St | :n-SE |
430 | N2 | highway | bus_stop | South St | :n-NW |
431 | N3 | highway | bus_stop | North St | :n-S-unglued |
432 | N4 | highway | bus_stop | South St | :n-N-unglued |
434 | osm | class | type | name | geometry |
435 | W1 | highway | secondary | North St | :w-north |
436 | W2 | highway | unclassified | South St | :w-south |
439 | 1 | 100,101,2,103,104 |
440 | 2 | 200,201,1,202,203 |
443 | object | parent_place_id |
449 Scenario: POIs do not parent non-roads they are attached to
450 Given the scene points-on-roads
452 | osm | class | type | street | geometry |
453 | N1 | highway | bus_stop | North St | :n-SE |
454 | N2 | highway | bus_stop | South St | :n-NW |
456 | osm | class | type | name | geometry |
457 | W1 | landuse | residential | North St | :w-north |
458 | W2 | waterway| river | South St | :w-south |
461 | 1 | 100,101,2,103,104 |
462 | 2 | 200,201,1,202,203 |
465 | object | parent_place_id |
469 Scenario: POIs on building outlines inherit associated street relation
470 Given the scene building-on-street-corner
472 | osm | class | type | geometry |
473 | N1 | place | house | :n-edge-NS |
474 | W1 | building | yes | :w-building |
476 | osm | class | type | name | geometry |
477 | W2 | highway | primary | bar | :w-WE |
478 | W3 | highway | residential | foo | :w-NS |
480 | id | members | tags+type |
481 | 1 | W1:house,W2:street | associatedStreet |
484 | 1 | 100,1,101,102,100 |
487 | object | parent_place_id |
491 Scenario: Full names should be preferably matched for nearest road
498 | osm | class | type | name+name | geometry |
499 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
500 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
501 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
503 | osm | class | type | addr+street |
504 | N10 | shop | yes | Via Cavassico superiore |
507 | object | parent_place_id |
510 Scenario: place=square may be parented via addr:place
516 | osm | class | type | name+name | geometry |
517 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
519 | osm | class | type | name+name | housenr | addr_place | geometry |
520 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
523 | object | rank_address |
526 | object | parent_place_id |