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
20 Scenario: Waterways are linked when in waterway relations
21 Given the scene split-road
23 | osm_type | osm_id | class | type | name | geometry
24 | W | 1 | waterway | river | Rhein | :w-2
25 | W | 2 | waterway | river | Rhein | :w-3
26 | R | 13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3
27 | R | 23 | waterway | river | Limmat| :w-4a
30 | 13 | R23:tributary,W1,W2:main_stream | 'type' : 'waterway'
32 Then table placex contains
33 | object | linked_place_id
38 When sending query "rhein"
44 Scenario: Relations are not linked when in waterway relations
45 Given the scene split-road
47 | osm_type | osm_id | class | type | name | geometry
48 | W | 1 | waterway | river | Rhein | :w-2
49 | W | 2 | waterway | river | Rhein | :w-3
50 | R | 1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3
51 | R | 2 | waterway | river | Limmat| :w-4a
54 | 1 | R2 | 'type' : 'waterway'
56 Then table placex contains
57 | object | linked_place_id
64 Scenario: Empty waterway relations are handled correctly
65 Given the scene split-road
67 | osm_type | osm_id | class | type | name | geometry
68 | R | 1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3
71 | 1 | | 'type' : 'waterway'
73 Then table placex contains
74 | object | linked_place_id
78 Scenario: Waterways are not linked when waterway types don't match
79 Given the scene split-road
81 | osm_type | osm_id | class | type | name | geometry
82 | W | 1 | waterway | drain | Rhein | :w-2
83 | R | 1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3
86 | 1 | N23,N34,W1,R45 | 'type' : 'multipolygon'
88 Then table placex contains
89 | object | linked_place_id
92 When sending query "rhein"
99 Scenario: Side streams are linked only when they have the same name
100 Given the scene split-road
102 | osm_type | osm_id | class | type | name | geometry
103 | W | 1 | waterway | river | Rhein2 | :w-2
104 | W | 2 | waterway | river | Rhein | :w-3
105 | R | 1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3
107 | id | members | tags
108 | 1 | W1:side_stream,W2:side_stream | 'type' : 'waterway'
110 Then table placex contains
111 | object | linked_place_id
114 When sending query "rhein2"