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 |
379 When sending geocodejson search query "3, foo" with address
384 Scenario: POIs don't inherit from streets
385 Given the scene building-on-street-corner
387 | osm | class | type | geometry |
388 | N1 | amenity | bank | :n-inner |
390 | osm | class | type | street | addr_place | housenr | geometry |
391 | W1 | highway | path | foo | nowhere | 3 | :w-building |
393 | osm | class | type | name | geometry |
394 | W3 | highway | residential | foo | :w-NS |
397 | object | parent_place_id | housenumber |
400 Scenario: POIs with own address do not inherit building address
401 Given the scene building-on-street-corner
403 | osm | class | type | street | geometry |
404 | N1 | amenity | bank | bar | :n-inner |
406 | osm | class | type | housenr | geometry |
407 | N2 | shop | bakery | 4 | :n-edge-NS |
409 | osm | class | type | addr_place | geometry |
410 | N3 | shop | supermarket| nowhere | :n-edge-WE |
412 | osm | class | type | name | geometry |
413 | N4 | place | isolated_dwelling | theplace | :n-outer |
415 | osm | class | type | addr_place | housenr | geometry |
416 | W1 | building | yes | theplace | 3 | :w-building |
418 | osm | class | type | name | geometry |
419 | W2 | highway | primary | bar | :w-WE |
420 | W3 | highway | residential | foo | :w-NS |
423 | object | parent_place_id | housenumber |
429 Scenario: POIs parent a road if they are attached to it
430 Given the scene points-on-roads
432 | osm | class | type | street | geometry |
433 | N1 | highway | bus_stop | North St | :n-SE |
434 | N2 | highway | bus_stop | South St | :n-NW |
435 | N3 | highway | bus_stop | North St | :n-S-unglued |
436 | N4 | highway | bus_stop | South St | :n-N-unglued |
438 | osm | class | type | name | geometry |
439 | W1 | highway | secondary | North St | :w-north |
440 | W2 | highway | unclassified | South St | :w-south |
443 | 1 | 100,101,2,103,104 |
444 | 2 | 200,201,1,202,203 |
447 | object | parent_place_id |
453 Scenario: POIs do not parent non-roads they are attached to
454 Given the scene points-on-roads
456 | osm | class | type | street | geometry |
457 | N1 | highway | bus_stop | North St | :n-SE |
458 | N2 | highway | bus_stop | South St | :n-NW |
460 | osm | class | type | name | geometry |
461 | W1 | landuse | residential | North St | :w-north |
462 | W2 | waterway| river | South St | :w-south |
465 | 1 | 100,101,2,103,104 |
466 | 2 | 200,201,1,202,203 |
469 | object | parent_place_id |
473 Scenario: POIs on building outlines inherit associated street relation
474 Given the scene building-on-street-corner
476 | osm | class | type | geometry |
477 | N1 | place | house | :n-edge-NS |
478 | W1 | building | yes | :w-building |
480 | osm | class | type | name | geometry |
481 | W2 | highway | primary | bar | :w-WE |
482 | W3 | highway | residential | foo | :w-NS |
484 | id | members | tags+type |
485 | 1 | W1:house,W2:street | associatedStreet |
488 | 1 | 100,1,101,102,100 |
491 | object | parent_place_id |
495 Scenario: Full names should be preferably matched for nearest road
502 | osm | class | type | name+name | geometry |
503 | W1 | highway | residential | Via Cavassico superiore | 1, 2 |
504 | W3 | highway | residential | Via Cavassico superiore | 2, 5 |
505 | W2 | highway | primary | Via Frazione Cavassico | 3, 4 |
507 | osm | class | type | addr+street |
508 | N10 | shop | yes | Via Cavassico superiore |
511 | object | parent_place_id |
514 Scenario: place=square may be parented via addr:place
520 | osm | class | type | name+name | geometry |
521 | W2 | place | square | Foo pl | (5, 6, 7, 8, 5) |
523 | osm | class | type | name+name | housenr | addr_place | geometry |
524 | N10 | shop | grocery | le shop | 5 | Foo pl | 9 |
527 | object | rank_address |
530 | object | parent_place_id |