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       |
 
  12           | osm | class | type   | addr+interpolation | geometry |
 
  13           | W1  | place | houses | even               | 1,2      |
 
  18         Then W1 expands to no interpolation
 
  20     Scenario: Simple even interpolation line with two points
 
  21         Given the grid with origin 1,1
 
  25           | osm | class | type   | housenr |
 
  26           | N1  | place | house  | 2       |
 
  27           | N2  | place | house  | 6       |
 
  29           | osm | class | type   | addr+interpolation | geometry |
 
  30           | W1  | place | houses | even               | 1,2      |
 
  32           | osm | class   | type        | geometry |
 
  33           | W10 | highway | residential | 4,5      |
 
  38         Then W1 expands to interpolation
 
  39           | start | end | geometry |
 
  42     Scenario: Backwards even two point interpolation line
 
  43         Given the grid with origin 1,1
 
  47           | osm | class | type   | housenr |
 
  48           | N1  | place | house  | 2       |
 
  49           | N2  | place | house  | 8       |
 
  51           | osm | class | type   | addr+interpolation | geometry |
 
  52           | W1  | place | houses | even               | 2,1      |
 
  54           | osm | class   | type        | geometry |
 
  55           | W10 | highway | residential | 4,5      |
 
  60         Then W1 expands to interpolation
 
  61           | start | end | geometry |
 
  64     Scenario: Simple odd two point interpolation
 
  65         Given the grid with origin 1,1
 
  69           | osm | class | type   | housenr |
 
  70           | N1  | place | house  | 1       |
 
  71           | N2  | place | house  | 11      |
 
  73           | osm | class | type   | addr+interpolation | geometry |
 
  74           | W1  | place | houses | odd                | 1,2      |
 
  76           | osm | class   | type        | geometry |
 
  77           | W10 | highway | residential | 4,5      |
 
  82         Then W1 expands to interpolation
 
  83           | start | end | geometry |
 
  86     Scenario: Simple all two point interpolation
 
  87         Given the grid with origin 1,1
 
  91           | osm | class | type   | housenr |
 
  92           | N1  | place | house  | 1       |
 
  93           | N2  | place | house  | 4       |
 
  95           | osm | class | type   | addr+interpolation | geometry |
 
  96           | W1  | place | houses | all                | 1,2      |
 
  98           | osm | class   | type        | geometry |
 
  99           | W10 | highway | residential | 4,5      |
 
 104         Then W1 expands to interpolation
 
 105           | start | end | geometry |
 
 108     Scenario: Even two point interpolation line with intermediate empty node
 
 110           | 1 | 8 |  | 3 | 9 | 2 |
 
 113           | osm | class | type   | housenr |
 
 114           | N1  | place | house  | 2       |
 
 115           | N2  | place | house  | 12      |
 
 117           | osm | class | type   | addr+interpolation | geometry |
 
 118           | W1  | place | houses | even               | 1,3,2    |
 
 120           | osm | class   | type        | geometry |
 
 121           | W10 | highway | residential | 4,5      |
 
 126         Then W1 expands to interpolation
 
 127           | start | end | geometry |
 
 130     Scenario: Even two point interpolation line with intermediate duplicated empty node
 
 133           | 1 | 8 | 3 | 9 | 2 |
 
 135           | osm | class | type   | housenr |
 
 136           | N1  | place | house  | 2       |
 
 137           | N2  | place | house  | 10      |
 
 139           | osm | class | type   | addr+interpolation | geometry |
 
 140           | W1  | place | houses | even               | 1,3,2 |
 
 142           | osm | class   | type        | geometry |
 
 143           | W10 | highway | residential | 4,5      |
 
 148         Then W1 expands to interpolation
 
 149           | start | end | geometry |
 
 152     Scenario: Simple even three point interpolation line
 
 155           | 1 | 8 |  | 9 | 3 | 7 | 2 |
 
 157           | osm | class | type   | housenr |
 
 158           | N1  | place | house  | 2       |
 
 159           | N2  | place | house  | 14      |
 
 160           | N3  | place | house  | 10      |
 
 162           | osm | class | type   | addr+interpolation | geometry |
 
 163           | W1  | place | houses | even               | 1,3,2    |
 
 165           | osm | class   | type        | geometry |
 
 166           | W10 | highway | residential | 4,5      |
 
 171         Then W1 expands to interpolation
 
 172           | start | end | geometry |
 
 176     Scenario: Simple even four point interpolation line
 
 178           | 1 | 10 |   | 11 | 3 |
 
 182           | osm | class | type  | housenr |
 
 183           | N1  | place | house | 2       |
 
 184           | N2  | place | house | 14      |
 
 185           | N3  | place | house | 10      |
 
 186           | N4  | place | house | 18      |
 
 188           | osm | class | type   | addr+interpolation | geometry |
 
 189           | W1  | place | houses | even               | 1,3,2,4  |
 
 191           | osm | class   | type        | geometry |
 
 192           | W10 | highway | residential | 1,3,2,4  |
 
 197         Then W1 expands to interpolation
 
 198           | start | end | geometry |
 
 203     Scenario: Reverse simple even three point interpolation line
 
 205           | 1 | 8  |  | 9 | 3 | 7 | 2 |
 
 208           | osm | class | type  | housenr |
 
 209           | N1  | place | house | 2       |
 
 210           | N2  | place | house | 14      |
 
 211           | N3  | place | house | 10      |
 
 213           | osm | class | type   | addr+interpolation | geometry |
 
 214           | W1  | place | houses | even               | 2,3,1    |
 
 216           | osm | class   | type        | geometry |
 
 217           | W10 | highway | residential | 4,5      |
 
 222         Then W1 expands to interpolation
 
 223           | start | end | geometry |
 
 227     Scenario: Even three point interpolation line with odd center point
 
 229           | 1 |  | 10 |  | 11 | 3 | 2 |
 
 232           | osm | class | type  | housenr |
 
 233           | N1  | place | house | 2       |
 
 234           | N2  | place | house | 8       |
 
 235           | N3  | place | house | 7       |
 
 237           | osm | class | type   | addr+interpolation | geometry |
 
 238           | W1  | place | houses | even               | 1,3,2    |
 
 240           | osm | class   | type        | geometry |
 
 241           | W10 | highway | residential | 4,5      |
 
 246         Then W1 expands to interpolation
 
 247           | start | end | geometry |
 
 250     Scenario: Interpolation line with self-intersecting way
 
 256           | osm | class | type  | housenr |
 
 257           | N1  | place | house | 2       |
 
 258           | N2  | place | house | 6       |
 
 259           | N3  | place | house | 10      |
 
 261           | osm | class | type   | addr+interpolation | geometry |
 
 262           | W1  | place | houses | even               | 1,2,3,2  |
 
 264           | osm | class   | type        | geometry |
 
 265           | W10 | highway | residential | 1,2,3    |
 
 270         Then W1 expands to interpolation
 
 271           | start | end | geometry |
 
 276     Scenario: Interpolation line with self-intersecting way II
 
 281           | osm | class | type  | housenr |
 
 282           | N1  | place | house | 2       |
 
 283           | N2  | place | house | 6       |
 
 285           | osm | class | type   | addr+interpolation | geometry |
 
 286           | W1  | place | houses | even               | 1,2,3,2  |
 
 288           | osm | class   | type        | geometry |
 
 289           | W10 | highway | residential | 1,2,3    |
 
 294         Then W1 expands to interpolation
 
 295           | start | end | geometry |
 
 298     Scenario: addr:street on interpolation way
 
 304           | osm | class | type  | housenr | geometry |
 
 305           | N1  | place | house | 2       | 1        |
 
 306           | N2  | place | house | 6       | 2        |
 
 307           | N3  | place | house | 12      | 1        |
 
 308           | N4  | place | house | 16      | 2        |
 
 310           | osm | class   | type    | addr+interpolation | street       | geometry |
 
 311           | W10 | place   | houses  | even               |              | 1,2      |
 
 312           | W11 | place   | houses  | even               | Cloud Street | 1,2      |
 
 314           | osm | class   | type     | name         | geometry |
 
 315           | W2  | highway | tertiary | Sun Way      | 10,11    |
 
 316           | W3  | highway | tertiary | Cloud Street | 20,21    |
 
 323           | object | parent_place_id |
 
 328         Then W10 expands to interpolation
 
 329           | parent_place_id | start | end |
 
 331         Then W11 expands to interpolation
 
 332           | parent_place_id | start | end |
 
 334         When geocoding "16 Cloud Street"
 
 335         Then result 0 contains
 
 338         When geocoding "14 Cloud Street"
 
 339         Then result 0 contains
 
 343     Scenario: addr:street on housenumber way
 
 349           | osm | class | type  | housenr | street       | geometry |
 
 350           | N1  | place | house | 2       |              | 1        |
 
 351           | N2  | place | house | 6       |              | 2        |
 
 352           | N3  | place | house | 12      | Cloud Street | 1        |
 
 353           | N4  | place | house | 16      | Cloud Street | 2        |
 
 355           | osm | class   | type    | addr+interpolation | geometry |
 
 356           | W10 | place   | houses  | even               | 1,2      |
 
 357           | W11 | place   | houses  | even               | 1,2      |
 
 359           | osm | class   | type     | name         | geometry |
 
 360           | W2  | highway | tertiary | Sun Way      | 10,11    |
 
 361           | W3  | highway | tertiary | Cloud Street | 20,21    |
 
 368           | object | parent_place_id |
 
 373         Then W10 expands to interpolation
 
 374           | parent_place_id | start | end |
 
 376         Then W11 expands to interpolation
 
 377           | parent_place_id | start | end |
 
 379         When geocoding "16 Cloud Street"
 
 380         Then result 0 contains
 
 383         When geocoding "14 Cloud Street"
 
 384         Then result 0 contains
 
 388     Scenario: Geometry of points and way don't match (github #253)
 
 390           | osm | class | type        | housenr | geometry |
 
 391           | N1  | place | house       | 10      | 144.9632341 -37.76163 |
 
 392           | N2  | place | house       | 6       | 144.9630541 -37.7628174 |
 
 393           | N3  | shop  | supermarket | 2       | 144.9629794 -37.7630755 |
 
 395           | osm | class | type   | addr+interpolation | geometry |
 
 396           | W1  | place | houses | even    | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755 |
 
 398           | osm | class   | type        | geometry |
 
 399           | W10 | highway | residential | 144.9632341 -37.76163,144.9629794 -37.7630755    |
 
 404         Then W1 expands to interpolation
 
 405           | start | end | geometry |
 
 406           | 4     | 4   | 144.96301672 -37.76294644 |
 
 407           | 8     | 8   | 144.96314407 -37.762223692 |
 
 409     Scenario: Place with missing address information
 
 414           | osm | class   | type   | housenr |
 
 415           | N1  | place   | house  | 23      |
 
 416           | N2  | amenity | school |         |
 
 417           | N3  | place   | house  | 29      |
 
 419           | osm | class | type   | addr+interpolation | geometry |
 
 420           | W1  | place | houses | odd                | 1,2,3 |
 
 422           | osm | class   | type        | geometry |
 
 423           | W10 | highway | residential | 4,5      |
 
 428         Then W1 expands to interpolation
 
 429           | start | end | geometry |
 
 430           | 25    | 27  | 0.0000166 0,0.00002 0,0.0000333 0 |
 
 432     Scenario: Ways without node entries are ignored
 
 434           | osm | class | type   | housenr | geometry |
 
 435           | W1  | place | houses | even    | 1 1, 1 1.001 |
 
 437           | osm | class   | type        | geometry |
 
 438           | W10 | highway | residential | 1 1, 1 1.001 |
 
 440         Then W1 expands to no interpolation
 
 442     Scenario: Ways with nodes without housenumbers are ignored
 
 447           | osm | class | type   |
 
 448           | N1  | place | house  |
 
 449           | N2  | place | house  |
 
 451           | osm | class | type   | housenr | geometry |
 
 452           | W1  | place | houses | even    | 1,2 |
 
 454           | osm | class   | type        | geometry |
 
 455           | W10 | highway | residential | 4,5      |
 
 457         Then W1 expands to no interpolation
 
 459     Scenario: Two point interpolation starting at 0
 
 460         Given the grid with origin 1,1
 
 461           | 1 | 10 |  |  | 11 | 2 |
 
 464           | osm | class | type   | housenr |
 
 465           | N1  | place | house  | 0       |
 
 466           | N2  | place | house  | 10      |
 
 468           | osm | class | type   | addr+interpolation | geometry |
 
 469           | W1  | place | houses | even               | 1,2      |
 
 471           | osm | class   | type        | name        | geometry |
 
 472           | W10 | highway | residential | London Road |4,5      |
 
 477         Then W1 expands to interpolation
 
 478           | start | end | geometry |
 
 480         When reverse geocoding 1,1
 
 481         Then the result contains
 
 482           | object | type  | display_name |
 
 483           | N1     | house | 0, London Road |
 
 485     Scenario: Parenting of interpolation with additional tags
 
 493           | osm | class | type  | housenr | addr+street |
 
 494           | N8  | place | house | 10      | Horiz St    |
 
 495           | N9  | place | house | 16      | Horiz St    |
 
 497           | osm | class   | type        | name     | geometry |
 
 498           | W1  | highway | residential | Vert St  | 1,2      |
 
 499           | W2  | highway | residential | Horiz St | 2,3      |
 
 501           | osm | class | type   | addr+interpolation | addr+inclusion | geometry |
 
 502           | W10 | place | houses | even               | actual         | 8,9      |
 
 508           | object | parent_place_id |
 
 511         And W10 expands to interpolation
 
 512           | start | end | parent_place_id |
 
 516     Scenario Outline: Bad interpolation values are ignored
 
 517         Given the grid with origin 1,1
 
 521           | osm | class | type   | housenr |
 
 522           | N1  | place | house  | 2       |
 
 523           | N2  | place | house  | 6       |
 
 525           | osm | class | type   | addr+interpolation | geometry |
 
 526           | W1  | place | houses | <value>            | 1,2      |
 
 528           | osm | class   | type        | geometry |
 
 529           | W10 | highway | residential | 4,5      |
 
 534         Then W1 expands to no interpolation
 
 543     Scenario: Interpolation line where points have been moved (Github #3022)
 
 544         Given the 0.00001 grid
 
 545          | 1 | | | | | | | | 2 | 3 | 9 | | | | | | | | 4 |
 
 547           | osm | class | type   | housenr | geometry |
 
 548           | N1  | place | house  | 2       | 1 |
 
 549           | N2  | place | house  | 18      | 3 |
 
 550           | N3  | place | house  | 24      | 9 |
 
 551           | N4  | place | house  | 42      | 4 |
 
 553           | osm | class | type   | addr+interpolation | geometry |
 
 554           | W1  | place | houses | even               | 1,2,3,4  |
 
 556           | osm | class   | type        | geometry |
 
 557           | W10 | highway | residential | 1,4      |
 
 562         Then W1 expands to interpolation
 
 569     Scenario: Interpolation line with duplicated points
 
 571           | 7 | 10 | 8 | 11 | 9 |
 
 574           | osm | class | type   | housenr | geometry |
 
 575           | N1  | place | house  | 2       | 7 |
 
 576           | N2  | place | house  | 6       | 8 |
 
 577           | N3  | place | house  | 10      | 8 |
 
 578           | N4  | place | house  | 14      | 9 |
 
 580           | osm | class | type   | addr+interpolation | geometry |
 
 581           | W1  | place | houses | even               | 7,8,8,9  |
 
 583           | osm | class   | type        | geometry |
 
 584           | W10 | highway | residential | 4,5      |
 
 589         Then W1 expands to interpolation
 
 590           | start | end | geometry |
 
 595     Scenario: Interpolaton line with broken way geometry (Github #2986)
 
 597           | 1 | 8 | 10 | 11 | 9 | 2 | 3 | 4 |
 
 599           | osm | class | type   | housenr |
 
 600           | N1  | place | house  | 2       |
 
 601           | N2  | place | house  | 8       |
 
 602           | N3  | place | house  | 12      |
 
 603           | N4  | place | house  | 14      |
 
 605           | osm | class | type   | addr+interpolation | geometry |
 
 606           | W1  | place | houses | even               | 8,9      |
 
 608           | osm | class   | type        | geometry |
 
 609           | W10 | highway | residential | 1,4      |
 
 614         Then W1 expands to interpolation
 
 615           | start | end | geometry |