1 Feature: Import of address interpolations
2 Tests that interpolated addresses are added correctly
4 Scenario: Simple even interpolation line with two points and no street nearby
5 Given the grid with origin 1,1
8 | osm | class | type | housenr |
9 | N1 | place | house | 2 |
10 | N2 | place | house | 6 |
11 And the interpolations
12 | osm | type | geometry | nodes |
13 | W1 | even | 1,2 | 1,2 |
15 Then W1 expands to no interpolation
17 Scenario: Simple even interpolation line with two points
18 Given the grid with origin 1,1
22 | osm | class | type | housenr |
23 | N1 | place | house | 2 |
24 | N2 | place | house | 6 |
25 And the interpolations
26 | osm | type | geometry | nodes |
27 | W1 | even | 1,2 | 1,2 |
29 | osm | class | type | geometry |
30 | W10 | highway | residential | 4,5 |
32 Then W1 expands to interpolation
33 | start | end | geometry |
36 Scenario: Backwards even two point interpolation line
37 Given the grid with origin 1,1
41 | osm | class | type | housenr |
42 | N1 | place | house | 2 |
43 | N2 | place | house | 8 |
44 And the interpolations
45 | osm | type | geometry | nodes |
46 | W1 | even | 2,1 | 2,1 |
48 | osm | class | type | geometry |
49 | W10 | highway | residential | 4,5 |
51 Then W1 expands to interpolation
52 | start | end | geometry |
55 Scenario: Simple odd two point interpolation
56 Given the grid with origin 1,1
60 | osm | class | type | housenr |
61 | N1 | place | house | 1 |
62 | N2 | place | house | 11 |
63 And the interpolations
64 | osm | type | geometry | nodes |
65 | W1 | odd | 1,2 | 1,2 |
67 | osm | class | type | geometry |
68 | W10 | highway | residential | 4,5 |
70 Then W1 expands to interpolation
71 | start | end | geometry |
74 Scenario: Simple all two point interpolation
75 Given the grid with origin 1,1
79 | osm | class | type | housenr |
80 | N1 | place | house | 1 |
81 | N2 | place | house | 4 |
82 And the interpolations
83 | osm | type | geometry | nodes |
84 | W1 | all | 1,2 | 1,2 |
86 | osm | class | type | geometry |
87 | W10 | highway | residential | 4,5 |
89 Then W1 expands to interpolation
90 | start | end | geometry |
93 Scenario: Even two point interpolation line with intermediate empty node
95 | 1 | 8 | | 3 | 9 | 2 |
98 | osm | class | type | housenr |
99 | N1 | place | house | 2 |
100 | N2 | place | house | 12 |
101 And the interpolations
102 | osm | type | geometry | nodes |
103 | W1 | even | 1,3,2 | 1,3,2 |
105 | osm | class | type | geometry |
106 | W10 | highway | residential | 4,5 |
108 Then W1 expands to interpolation
109 | start | end | geometry |
112 Scenario: Even two point interpolation line with intermediate duplicated empty node
115 | 1 | 8 | 3 | 9 | 2 |
117 | osm | class | type | housenr |
118 | N1 | place | house | 2 |
119 | N2 | place | house | 10 |
120 And the interpolations
121 | osm | type | geometry | nodes |
122 | W1 | even | 1,3,2 | 1,3,3,2 |
124 | osm | class | type | geometry |
125 | W10 | highway | residential | 4,5 |
127 Then W1 expands to interpolation
128 | start | end | geometry |
131 Scenario: Simple even three point interpolation line
134 | 1 | 8 | | 9 | 3 | 7 | 2 |
136 | osm | class | type | housenr |
137 | N1 | place | house | 2 |
138 | N2 | place | house | 14 |
139 | N3 | place | house | 10 |
140 And the interpolations
141 | osm | type | geometry | nodes |
142 | W1 | even | 1,3,2 | 1,3,2 |
144 | osm | class | type | geometry |
145 | W10 | highway | residential | 4,5 |
147 Then W1 expands to interpolation
148 | start | end | geometry |
152 Scenario: Simple even four point interpolation line
154 | 1 | 10 | | 11 | 3 |
158 | osm | class | type | housenr |
159 | N1 | place | house | 2 |
160 | N2 | place | house | 14 |
161 | N3 | place | house | 10 |
162 | N4 | place | house | 18 |
163 And the interpolations
164 | osm | type | geometry | nodes |
165 | W1 | even | 1,3,2,4 | 1,3,2,4 |
167 | osm | class | type | geometry |
168 | W10 | highway | residential | 1,3,2,4 |
170 Then W1 expands to interpolation
171 | start | end | geometry |
176 Scenario: Reverse simple even three point interpolation line
178 | 1 | 8 | | 9 | 3 | 7 | 2 |
181 | osm | class | type | housenr |
182 | N1 | place | house | 2 |
183 | N2 | place | house | 14 |
184 | N3 | place | house | 10 |
185 And the interpolations
186 | osm | type | geometry | nodes |
187 | W1 | even | 2,3,1 | 2,3,1 |
189 | osm | class | type | geometry |
190 | W10 | highway | residential | 4,5 |
192 Then W1 expands to interpolation
193 | start | end | geometry |
197 Scenario: Even three point interpolation line with odd center point
199 | 1 | | 10 | | 11 | 3 | 2 |
202 | osm | class | type | housenr |
203 | N1 | place | house | 2 |
204 | N2 | place | house | 8 |
205 | N3 | place | house | 7 |
206 And the interpolations
207 | osm | type | geometry | nodes |
208 | W1 | even | 1,3,2 | 1,3,2 |
210 | osm | class | type | geometry |
211 | W10 | highway | residential | 4,5 |
213 Then W1 expands to interpolation
214 | start | end | geometry |
217 Scenario: Interpolation line with self-intersecting way
223 | osm | class | type | housenr |
224 | N1 | place | house | 2 |
225 | N2 | place | house | 6 |
226 | N3 | place | house | 10 |
227 And the interpolations
228 | osm | type | geometry | nodes |
229 | W1 | even | 1,2,3,2 | 1,2,3,2 |
231 | osm | class | type | geometry |
232 | W10 | highway | residential | 1,2,3 |
234 Then W1 expands to interpolation
235 | start | end | geometry |
240 Scenario: Interpolation line with self-intersecting way II
245 | osm | class | type | housenr |
246 | N1 | place | house | 2 |
247 | N2 | place | house | 6 |
248 And the interpolations
249 | osm | type | geometry | nodes |
250 | W1 | even | 1,2,3,2 | 1,2,3,2 |
252 | osm | class | type | geometry |
253 | W10 | highway | residential | 1,2,3 |
255 Then W1 expands to interpolation
256 | start | end | geometry |
259 Scenario: addr:street on interpolation way
265 | osm | class | type | housenr | geometry |
266 | N1 | place | house | 2 | 1 |
267 | N2 | place | house | 6 | 2 |
268 | N3 | place | house | 12 | 1 |
269 | N4 | place | house | 16 | 2 |
270 And the interpolations
271 | osm | type | street | nodes | geometry | nodes |
272 | W10 | even | | 1,2 | 1,2 | 1,2 |
273 | W11 | even | Cloud Street | 3,4 | 1,2 | 3,4 |
275 | osm | class | type | name | geometry |
276 | W2 | highway | tertiary | Sun Way | 10,11 |
277 | W3 | highway | tertiary | Cloud Street | 20,21 |
280 | object | parent_place_id |
285 Then W10 expands to interpolation
286 | parent_place_id | start | end |
288 Then W11 expands to interpolation
289 | parent_place_id | start | end |
291 When geocoding "16 Cloud Street"
292 Then result 0 contains
295 When geocoding "14 Cloud Street"
296 Then result 0 contains
300 Scenario: addr:street on housenumber way
306 | osm | class | type | housenr | street | geometry |
307 | N1 | place | house | 2 | | 1 |
308 | N2 | place | house | 6 | | 2 |
309 | N3 | place | house | 12 | Cloud Street | 1 |
310 | N4 | place | house | 16 | Cloud Street | 2 |
311 And the interpolations
312 | osm | type | geometry | nodes |
313 | W10 | even | 1,2 | 1,2 |
314 | W11 | even | 1,2 | 3,4 |
316 | osm | class | type | name | geometry |
317 | W2 | highway | tertiary | Sun Way | 10,11 |
318 | W3 | highway | tertiary | Cloud Street | 20,21 |
321 | object | parent_place_id |
326 Then W10 expands to interpolation
327 | parent_place_id | start | end |
329 Then W11 expands to interpolation
330 | parent_place_id | start | end |
332 When geocoding "16 Cloud Street"
333 Then result 0 contains
336 When geocoding "14 Cloud Street"
337 Then result 0 contains
341 Scenario: Geometry of points and way don't match (github #253)
343 | osm | class | type | housenr | geometry |
344 | N1 | place | house | 10 | 144.9632341 -37.76163 |
345 | N2 | place | house | 6 | 144.9630541 -37.7628174 |
346 | N3 | shop | supermarket | 2 | 144.9629794 -37.7630755 |
347 And the interpolations
348 | osm | type | geometry | nodes |
349 | W1 | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755 | 1,2,3 |
351 | osm | class | type | geometry |
352 | W10 | highway | residential | 144.9632341 -37.76163,144.9629794 -37.7630755 |
354 Then W1 expands to interpolation
355 | start | end | geometry |
356 | 4 | 4 | 144.96301672 -37.76294644 |
357 | 8 | 8 | 144.96314407 -37.762223692 |
359 Scenario: Place with missing address information
364 | osm | class | type | housenr |
365 | N1 | place | house | 23 |
366 | N2 | amenity | school | |
367 | N3 | place | house | 29 |
368 And the interpolations
369 | osm | type | geometry | nodes |
370 | W1 | odd | 1,2,3 | 1,2,3 |
372 | osm | class | type | geometry |
373 | W10 | highway | residential | 4,5 |
375 Then W1 expands to interpolation
376 | start | end | geometry |
377 | 25 | 27 | 0.0000166 0,0.00002 0,0.0000333 0 |
379 Scenario: Ways without node entries are ignored
380 Given the interpolations
381 | osm | type | geometry | nodes |
382 | W1 | even | 1 1, 1 1.001 | 34,45 |
384 | osm | class | type | geometry |
385 | W10 | highway | residential | 1 1, 1 1.001 |
387 Then W1 expands to no interpolation
389 Scenario: Ways with nodes without housenumbers are ignored
394 | osm | class | type |
395 | N1 | place | house |
396 | N2 | place | house |
397 Given the interpolations
398 | osm | type | geometry | nodes |
399 | W1 | even | 1,2 | 1,2 |
401 | osm | class | type | geometry |
402 | W10 | highway | residential | 4,5 |
404 Then W1 expands to no interpolation
406 Scenario: Two point interpolation starting at 0
407 Given the grid with origin 1,1
408 | 1 | 10 | | | 11 | 2 |
411 | osm | class | type | housenr |
412 | N1 | place | house | 0 |
413 | N2 | place | house | 10 |
414 And the interpolations
415 | osm | type | geometry | nodes |
416 | W1 | even | 1,2 | 1,2 |
418 | osm | class | type | name | geometry |
419 | W10 | highway | residential | London Road |4,5 |
421 Then W1 expands to interpolation
422 | start | end | geometry |
424 When reverse geocoding 1,1
425 Then the result contains
426 | object | type | display_name |
427 | N1 | house | 0, London Road |
429 Scenario: Parenting of interpolation with additional tags
437 | osm | class | type | housenr | addr+street |
438 | N8 | place | house | 10 | Horiz St |
439 | N9 | place | house | 16 | Horiz St |
441 | osm | class | type | name | geometry |
442 | W1 | highway | residential | Vert St | 1,2 |
443 | W2 | highway | residential | Horiz St | 2,3 |
444 And the interpolations
445 | osm | type | addr+inclusion | geometry | nodes |
446 | W10 | even | actual | 8,9 | 8,9 |
449 | object | parent_place_id |
452 And W10 expands to interpolation
453 | start | end | parent_place_id |
457 Scenario Outline: Bad interpolation values are ignored
458 Given the grid with origin 1,1
462 | osm | class | type | housenr |
463 | N1 | place | house | 2 |
464 | N2 | place | house | 6 |
465 And the interpolations
466 | osm | type | geometry | nodes |
467 | W1 | <value> | 1,2 | 1,2 |
469 | osm | class | type | geometry |
470 | W10 | highway | residential | 4,5 |
472 Then W1 expands to no interpolation
481 Scenario: Interpolation line where points have been moved (Github #3022)
482 Given the 0.00001 grid
483 | 1 | | | | | | | | 2 | 3 | 9 | | | | | | | | 4 |
485 | osm | class | type | housenr | geometry |
486 | N1 | place | house | 2 | 1 |
487 | N2 | place | house | 18 | 3 |
488 | N3 | place | house | 24 | 9 |
489 | N4 | place | house | 42 | 4 |
490 And the interpolations
491 | osm | type | geometry | nodes |
492 | W1 | even | 1,2,3,4 | 1,2,3,4 |
494 | osm | class | type | geometry |
495 | W10 | highway | residential | 1,4 |
497 Then W1 expands to interpolation
504 Scenario: Interpolation line with duplicated points
506 | 7 | 10 | 8 | 11 | 9 |
509 | osm | class | type | housenr | geometry |
510 | N1 | place | house | 2 | 7 |
511 | N2 | place | house | 6 | 8 |
512 | N3 | place | house | 10 | 8 |
513 | N4 | place | house | 14 | 9 |
514 And the interpolations
515 | osm | type | geometry | nodes |
516 | W1 | even | 7,8,8,9 | 1,2,3,4 |
518 | osm | class | type | geometry |
519 | W10 | highway | residential | 4,5 |
521 Then W1 expands to interpolation
522 | start | end | geometry |
527 Scenario: Interpolaton line with broken way geometry (Github #2986)
529 | 1 | 8 | 10 | 11 | 9 | 2 | 3 | 4 |
531 | osm | class | type | housenr |
532 | N1 | place | house | 2 |
533 | N2 | place | house | 8 |
534 | N3 | place | house | 12 |
535 | N4 | place | house | 14 |
536 And the interpolations
537 | osm | type | geometry | nodes |
538 | W1 | even | 8,9 | 1,8,9,2,3,4 |
540 | osm | class | type | geometry |
541 | W10 | highway | residential | 1,4 |
543 Then W1 expands to interpolation
544 | start | end | geometry |