2 Feature: Linking of places
 
   3     Tests for correctly determining linked places
 
   5     Scenario: Only address-describing places can be linked
 
   6         Given the scene way-area-with-center
 
   8          | osm_type | osm_id | class   | type   | name  | geometry
 
   9          | R        | 13     | landuse | forest | Garbo | :area
 
  11          | osm_id | class   | type | name  | geometry
 
  12          | 256    | natural | peak | Garbo | :inner-C
 
  14         Then table placex contains
 
  15          | object  | linked_place_id
 
  19     Scenario: Waterways are linked when in waterway relations
 
  20         Given the scene split-road
 
  22          | osm_type | osm_id | class    | type  | name  | geometry
 
  23          | W        | 1      | waterway | river | Rhein | :w-2
 
  24          | W        | 2      | waterway | river | Rhein | :w-3
 
  25          | R        | 13     | waterway | river | Rhein | :w-1 + :w-2 + :w-3
 
  26          | R        | 23     | waterway | river | Limmat| :w-4a
 
  29          | 13 | R23:tributary,W1,W2:main_stream  | 'type' : 'waterway'
 
  31         Then table placex contains
 
  32          | object | linked_place_id
 
  37         When sending query "rhein"
 
  42     Scenario: Relations are not linked when in waterway relations
 
  43         Given the scene split-road
 
  45          | osm_type | osm_id | class    | type  | name  | geometry
 
  46          | W        | 1      | waterway | river | Rhein | :w-2
 
  47          | W        | 2      | waterway | river | Rhein | :w-3
 
  48          | R        | 1      | waterway | river | Rhein | :w-1 + :w-2 + :w-3
 
  49          | R        | 2      | waterway | river | Limmat| :w-4a
 
  52          | 1  | R2                               | 'type' : 'waterway'
 
  54         Then table placex contains
 
  55          | object | linked_place_id
 
  61     Scenario: Empty waterway relations are handled correctly
 
  62         Given the scene split-road
 
  64          | osm_type | osm_id | class    | type  | name  | geometry
 
  65          | R        | 1      | waterway | river | Rhein | :w-1 + :w-2 + :w-3
 
  68          | 1 |                                  | 'type' : 'waterway'
 
  70         Then table placex contains
 
  71          | object | linked_place_id
 
  74     Scenario: Waterways are not linked when waterway types don't match
 
  75         Given the scene split-road
 
  77          | osm_type | osm_id | class    | type     | name  | geometry
 
  78          | W        | 1      | waterway | drain    | Rhein | :w-2
 
  79          | R        | 1      | waterway | river    | Rhein | :w-1 + :w-2 + :w-3
 
  82          | 1  | N23,N34,W1,R45        | 'type' : 'multipolygon'
 
  84         Then table placex contains
 
  85          | object | linked_place_id
 
  88         When sending query "rhein"
 
  94     Scenario: Side streams are linked only when they have the same name
 
  95         Given the scene split-road
 
  97          | osm_type | osm_id | class    | type  | name   | geometry
 
  98          | W        | 1      | waterway | river | Rhein2 | :w-2
 
  99          | W        | 2      | waterway | river | Rhein  | :w-3
 
 100          | R        | 1      | waterway | river | Rhein  | :w-1 + :w-2 + :w-3
 
 102          | id | members                           | tags
 
 103          | 1  | W1:side_stream,W2:side_stream     | 'type' : 'waterway'
 
 105         Then table placex contains
 
 106          | object | linked_place_id
 
 109         When sending query "rhein2"