2 Feature: Parenting of objects
3 Tests that the correct parent is choosen
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 And search_name contains
22 | object | nameaddress_vector |
23 | N1 | 4, galoo, 12345 |
24 | N2 | 5, galoo, 99999 |
26 Scenario: Address without tags, closest street
27 Given the scene roads-with-pois
29 | osm | class | type | geometry |
30 | N1 | place | house | :p-N1 |
31 | N2 | place | house | :p-N2 |
32 | N3 | place | house | :p-S1 |
33 | N4 | place | house | :p-S2 |
35 | osm | class | type | geometry |
36 | W1 | highway | residential | :w-north |
37 | W2 | highway | residential | :w-south |
40 | object | parent_place_id |
46 Scenario: Address without tags avoids unnamed streets
47 Given the scene roads-with-pois
49 | osm | class | type | geometry |
50 | N1 | place | house | :p-N1 |
51 | N2 | place | house | :p-N2 |
52 | N3 | place | house | :p-S1 |
53 | N4 | place | house | :p-S2 |
54 | W1 | highway | residential | :w-north |
56 | osm | class | type | geometry |
57 | W2 | highway | residential | :w-south |
60 | object | parent_place_id |
66 Scenario: addr:street tag parents to appropriately named street
67 Given the scene roads-with-pois
69 | osm | class | type | street| geometry |
70 | N1 | place | house | south | :p-N1 |
71 | N2 | place | house | north | :p-N2 |
72 | N3 | place | house | south | :p-S1 |
73 | N4 | place | house | north | :p-S2 |
75 | osm | class | type | name | geometry |
76 | W1 | highway | residential | north | :w-north |
77 | W2 | highway | residential | south | :w-south |
80 | object | parent_place_id |
86 Scenario: addr:street tag parents to next named street
87 Given the scene roads-with-pois
89 | osm | class | type | street | geometry |
90 | N1 | place | house | abcdef | :p-N1 |
91 | N2 | place | house | abcdef | :p-N2 |
92 | N3 | place | house | abcdef | :p-S1 |
93 | N4 | place | house | abcdef | :p-S2 |
95 | osm | class | type | name | geometry |
96 | W1 | highway | residential | abcdef | :w-north |
97 | W2 | highway | residential | abcdef | :w-south |
100 | object | parent_place_id |
106 Scenario: addr:street tag without appropriately named street
107 Given the scene roads-with-pois
109 | osm | class | type | street | geometry |
110 | N1 | place | house | abcdef | :p-N1 |
111 | N2 | place | house | abcdef | :p-N2 |
112 | N3 | place | house | abcdef | :p-S1 |
113 | N4 | place | house | abcdef | :p-S2 |
115 | osm | class | type | name | geometry |
116 | W1 | highway | residential | abcde | :w-north |
117 | W2 | highway | residential | abcde | :w-south |
120 | object | parent_place_id |
126 Scenario: addr:place address
127 Given the scene road-with-alley
129 | osm | class | type | addr_place | geometry |
130 | N1 | place | house | myhamlet | :n-alley |
132 | osm | class | type | name | geometry |
133 | N2 | place | hamlet | myhamlet | :n-main-west |
134 | W1 | highway | residential | myhamlet | :w-main |
137 | object | parent_place_id |
140 Scenario: addr:street is preferred over addr:place
141 Given the scene road-with-alley
143 | osm | class | type | addr_place | street | geometry |
144 | N1 | place | house | myhamlet | mystreet| :n-alley |
146 | osm | class | type | name | geometry |
147 | N2 | place | hamlet | myhamlet | :n-main-west |
148 | W1 | highway | residential | mystreet | :w-main |
151 | object | parent_place_id |
154 Scenario: Untagged address in simple associated street relation
155 Given the scene road-with-alley
157 | osm | class | type | geometry |
158 | N1 | place | house | :n-alley |
159 | N2 | place | house | :n-corner |
160 | N3 | place | house | :n-main-west |
162 | osm | class | type | name | geometry |
163 | W1 | highway | residential | foo | :w-main |
164 | W2 | highway | service | bar | :w-alley |
166 | id | members | tags+type |
167 | 1 | W1:street,N1,N2,N3 | associatedStreet |
170 | object | parent_place_id |
175 Scenario: Avoid unnamed streets in simple associated street relation
176 Given the scene road-with-alley
178 | osm | class | type | geometry |
179 | N1 | place | house | :n-alley |
180 | N2 | place | house | :n-corner |
181 | N3 | place | house | :n-main-west |
182 | W2 | highway | residential | :w-alley |
184 | osm | class | type | geometry |
185 | W1 | highway | residential | :w-main |
187 | id | members | tags+type |
188 | 1 | N1,N2,N3,W2:street,W1:street | associatedStreet |
191 | object | parent_place_id |
196 Scenario: Associated street relation overrides addr:street
197 Given the scene road-with-alley
199 | osm | class | type | street | geometry |
200 | N1 | place | house | bar | :n-alley |
202 | osm | class | type | name | geometry |
203 | W1 | highway | residential | foo | :w-main |
204 | W2 | highway | residential | bar | :w-alley |
206 | id | members | tags+type |
207 | 1 | W1:street,N1,N2,N3 | associatedStreet |
210 | object | parent_place_id |
213 Scenario: Building without tags, closest street from center point
214 Given the scene building-on-street-corner
216 | osm | class | type | geometry |
217 | W1 | building | yes | :w-building |
218 | W2 | highway | primary | :w-WE |
219 | W3 | highway | residential | :w-NS |
222 | object | parent_place_id |
225 Scenario: Building with addr:street tags
226 Given the scene building-on-street-corner
228 | osm | class | type | street | geometry |
229 | W1 | building | yes | bar | :w-building |
231 | osm | class | type | name | geometry |
232 | W2 | highway | primary | bar | :w-WE |
233 | W3 | highway | residential | foo | :w-NS |
236 | object | parent_place_id |
239 Scenario: Building with addr:place tags
240 Given the scene building-on-street-corner
242 | osm | class | type | name | geometry |
243 | N1 | place | village | bar | :n-outer |
244 | W2 | highway | primary | bar | :w-WE |
245 | W3 | highway | residential | foo | :w-NS |
247 | osm | class | type | addr_place | geometry |
248 | W1 | building | yes | bar | :w-building |
251 | object | parent_place_id |
254 Scenario: Building in associated street relation
255 Given the scene building-on-street-corner
257 | osm | class | type | geometry |
258 | W1 | building | yes | :w-building |
260 | osm | class | type | name | geometry |
261 | W2 | highway | primary | bar | :w-WE |
262 | W3 | highway | residential | foo | :w-NS |
264 | id | members | tags+type |
265 | 1 | W1:house,W2:street | associatedStreet |
268 | object | parent_place_id |
271 Scenario: Building in associated street relation overrides addr:street
272 Given the scene building-on-street-corner
274 | osm | class | type | street | geometry |
275 | W1 | building | yes | foo | :w-building |
277 | osm | class | type | name | geometry |
278 | W2 | highway | primary | bar | :w-WE |
279 | W3 | highway | residential | foo | :w-NS |
281 | id | members | tags+type |
282 | 1 | W1:house,W2:street | associatedStreet |
285 | object | parent_place_id |
288 Scenario: Wrong member in associated street relation is ignored
289 Given the scene building-on-street-corner
291 | osm | class | type | geometry |
292 | N1 | place | house | :n-outer |
294 | osm | class | type | street | geometry |
295 | W1 | building | yes | foo | :w-building |
297 | osm | class | type | name | geometry |
298 | W2 | highway | primary | bar | :w-WE |
299 | W3 | highway | residential | foo | :w-NS |
301 | id | members | tags+type |
302 | 1 | N1:house,W1:street,W3:street | associatedStreet |
305 | object | parent_place_id |
308 Scenario: POIs in building inherit address
309 Given the scene building-on-street-corner
311 | osm | class | type | geometry |
312 | N1 | amenity | bank | :n-inner |
313 | N2 | shop | bakery | :n-edge-NS |
314 | N3 | shop | supermarket| :n-edge-WE |
316 | osm | class | type | street | addr_place | housenr | geometry |
317 | W1 | building | yes | foo | nowhere | 3 | :w-building |
319 | osm | class | type | name | geometry |
320 | W2 | highway | primary | bar | :w-WE |
321 | W3 | highway | residential | foo | :w-NS |
324 | object | parent_place_id | street | addr_place | housenumber |
325 | W1 | W3 | foo | nowhere | 3 |
326 | N1 | W3 | foo | nowhere | 3 |
327 | N2 | W3 | foo | nowhere | 3 |
328 | N3 | W3 | foo | nowhere | 3 |
330 Scenario: POIs don't inherit from streets
331 Given the scene building-on-street-corner
333 | osm | class | type | geometry |
334 | N1 | amenity | bank | :n-inner |
336 | osm | class | type | street | addr_place | housenr | geometry |
337 | W1 | highway | path | foo | nowhere | 3 | :w-building |
339 | osm | class | type | name | geometry |
340 | W3 | highway | residential | foo | :w-NS |
343 | object | parent_place_id | street | addr_place | housenumber |
344 | N1 | W3 | None | None | None |
346 Scenario: POIs with own address do not inherit building address
347 Given the scene building-on-street-corner
349 | osm | class | type | street | geometry |
350 | N1 | amenity | bank | bar | :n-inner |
352 | osm | class | type | housenr | geometry |
353 | N2 | shop | bakery | 4 | :n-edge-NS |
355 | osm | class | type | addr_place | geometry |
356 | N3 | shop | supermarket| nowhere | :n-edge-WE |
358 | osm | class | type | name | geometry |
359 | N4 | place | isolated_dwelling | theplace | :n-outer |
361 | osm | class | type | addr_place | housenr | geometry |
362 | W1 | building | yes | theplace | 3 | :w-building |
364 | osm | class | type | name | geometry |
365 | W2 | highway | primary | bar | :w-WE |
366 | W3 | highway | residential | foo | :w-NS |
369 | object | parent_place_id | street | addr_place | housenumber |
370 | W1 | N4 | None | theplace | 3 |
371 | N1 | W2 | bar | None | None |
372 | N2 | W3 | None | None | 4 |
373 | N3 | W2 | None | nowhere | None |
375 Scenario: POIs parent a road if they are attached to it
376 Given the scene points-on-roads
378 | osm | class | type | street | geometry |
379 | N1 | highway | bus_stop | North St | :n-SE |
380 | N2 | highway | bus_stop | South St | :n-NW |
381 | N3 | highway | bus_stop | North St | :n-S-unglued |
382 | N4 | highway | bus_stop | South St | :n-N-unglued |
384 | osm | class | type | name | geometry |
385 | W1 | highway | secondary | North St | :w-north |
386 | W2 | highway | unclassified | South St | :w-south |
389 | 1 | 100,101,2,103,104 |
390 | 2 | 200,201,1,202,203 |
393 | object | parent_place_id |
399 Scenario: POIs do not parent non-roads they are attached to
400 Given the scene points-on-roads
402 | osm | class | type | street | geometry |
403 | N1 | highway | bus_stop | North St | :n-SE |
404 | N2 | highway | bus_stop | South St | :n-NW |
406 | osm | class | type | name | geometry |
407 | W1 | landuse | residential | North St | :w-north |
408 | W2 | waterway| river | South St | :w-south |
411 | 1 | 100,101,2,103,104 |
412 | 2 | 200,201,1,202,203 |
415 | object | parent_place_id |
419 Scenario: POIs on building outlines inherit associated street relation
420 Given the scene building-on-street-corner
422 | osm | class | type | geometry |
423 | N1 | place | house | :n-edge-NS |
424 | W1 | building | yes | :w-building |
426 | osm | class | type | name | geometry |
427 | W2 | highway | primary | bar | :w-WE |
428 | W3 | highway | residential | foo | :w-NS |
430 | id | members | tags+type |
431 | 1 | W1:house,W2:street | associatedStreet |
434 | 1 | 100,1,101,102,100 |
437 | object | parent_place_id |