2 Feature: Linking of places
 
   3     Tests for correctly determining linked places
 
   5     Scenario: Waterways are linked when in waterway relations
 
   6         Given the scene split-road
 
   8          | osm_type | osm_id | class    | type  | name  | geometry
 
   9          | W        | 1      | waterway | river | Rhein | :w-2
 
  10          | W        | 2      | waterway | river | Rhein | :w-3
 
  11          | R        | 13     | waterway | river | Rhein | :w-1 + :w-2 + :w-3
 
  12          | R        | 23     | waterway | river | Limmat| :w-4a
 
  15          | 13 | R23:tributary,W1,W2:main_stream  | 'type' : 'waterway'
 
  17         Then table placex contains
 
  18          | object | linked_place_id
 
  23         When sending query "rhein"
 
  28     Scenario: Relations are not linked when in waterway relations
 
  29         Given the scene split-road
 
  31          | osm_type | osm_id | class    | type  | name  | geometry
 
  32          | W        | 1      | waterway | river | Rhein | :w-2
 
  33          | W        | 2      | waterway | river | Rhein | :w-3
 
  34          | R        | 1      | waterway | river | Rhein | :w-1 + :w-2 + :w-3
 
  35          | R        | 2      | waterway | river | Limmat| :w-4a
 
  38          | 1  | R2                               | 'type' : 'waterway'
 
  40         Then table placex contains
 
  41          | object | linked_place_id
 
  47     Scenario: Empty waterway relations are handled correctly
 
  48         Given the scene split-road
 
  50          | osm_type | osm_id | class    | type  | name  | geometry
 
  51          | R        | 1      | waterway | river | Rhein | :w-1 + :w-2 + :w-3
 
  54          | 1 |                                  | 'type' : 'waterway'
 
  56         Then table placex contains
 
  57          | object | linked_place_id
 
  60     Scenario: Waterways are not linked when waterway types don't match
 
  61         Given the scene split-road
 
  63          | osm_type | osm_id | class    | type     | name  | geometry
 
  64          | W        | 1      | waterway | drain    | Rhein | :w-2
 
  65          | R        | 1      | waterway | river    | Rhein | :w-1 + :w-2 + :w-3
 
  68          | 1  | N23,N34,W1,R45        | 'type' : 'multipolygon'
 
  70         Then table placex contains
 
  71          | object | linked_place_id
 
  74         When sending query "rhein"
 
  80     Scenario: Side streams are linked only when they have the same name
 
  81         Given the scene split-road
 
  83          | osm_type | osm_id | class    | type  | name   | geometry
 
  84          | W        | 1      | waterway | river | Rhein2 | :w-2
 
  85          | W        | 2      | waterway | river | Rhein  | :w-3
 
  86          | R        | 1      | waterway | river | Rhein  | :w-1 + :w-2 + :w-3
 
  89          | 1  | W1:side_stream,W2:side_stream     | 'type' : 'waterway'
 
  91         Then table placex contains
 
  92          | object | linked_place_id
 
  95         When sending query "rhein2"