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 | class | type | name | geometry |
9 | R13 | landuse | forest | Garbo | :area |
10 | N256 | natural | peak | Garbo | :inner-C |
13 | object | linked_place_id |
17 Scenario: Postcode areas cannot be linked
23 | osm | class | type | addr+postcode | extra+wikidata | geometry |
24 | R13 | boundary | postal_code | 123 | Q87493 | (1,2,3,4,1) |
25 | N25 | place | suburb | 123 | Q87493 | 9 |
28 | object | linked_place_id |
32 Scenario: Waterways are linked when in waterway relations
33 Given the scene split-road
35 | osm | class | type | name | geometry |
36 | W1 | waterway | river | Rhein | :w-2 |
37 | W2 | waterway | river | Rhein | :w-3 |
38 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
39 | R23 | waterway | river | Limmat| :w-4a |
41 | id | members | tags+type |
42 | 13 | R23:tributary,W1,W2:main_stream | waterway |
45 | object | linked_place_id |
50 When searching for "rhein"
55 Scenario: Relations are not linked when in waterway relations
56 Given the scene split-road
58 | osm | class | type | name | geometry |
59 | W1 | waterway | stream | Rhein | :w-2 |
60 | W2 | waterway | river | Rhein | :w-3 |
61 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
62 | R2 | waterway | river | Limmat| :w-4a |
64 | id | members | tags+type |
68 | object | linked_place_id |
74 Scenario: Empty waterway relations are handled correctly
75 Given the scene split-road
77 | osm | class | type | name | geometry |
78 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
80 | id | members | tags+type |
84 | object | linked_place_id |
87 Scenario: Waterways are not linked when the way type is not a river feature
88 Given the scene split-road
90 | osm | class | type | name | geometry |
91 | W1 | waterway | lock | Rhein | :w-2 |
92 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
94 | id | members | tags+type |
95 | 1 | N23,N34,W1,R45 | multipolygon |
98 | object | linked_place_id |
101 When searching for "rhein"
107 Scenario: Side streams are linked only when they have the same name
108 Given the scene split-road
110 | osm | class | type | name | geometry |
111 | W1 | waterway | river | Rhein2 | :w-2 |
112 | W2 | waterway | river | Rhein | :w-3 |
113 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
115 | id | members | tags+type |
116 | 1 | W1:side_stream,W2:side_stream | waterway |
119 | object | linked_place_id |
122 When searching for "rhein2"
128 Scenario: Boundaries should only be linked to places
129 Given the named places
130 | osm | class | type | extra+wikidata | admin | geometry |
131 | R1 | boundary | administrative | 34 | 8 | poly-area:0.1 |
133 | osm | class | type | geometry |
134 | N3 | natural | island | 0.00001 0 |
135 | N3 | place | city | 0.00001 0 |
141 | object | linked_place_id |
145 Scenario: Nodes with 'role' label are always linked
147 | osm | class | type | admin | name | geometry |
148 | R13 | boundary | administrative | 6 | Garbo | poly-area:0.1 |
149 | N2 | place | hamlet | 15 | Vario | 0.006 0.00001 |
151 | id | members | tags+type |
152 | 13 | N2:label | boundary |
155 | object | linked_place_id |
158 | object | centroid | name+name | extratags+linked_place |
159 | R13 | 0.006 0.00001 | Garbo | hamlet |
161 Scenario: Boundaries with place tags are linked against places with same type
163 | osm | class | type | admin | name | extra+place | geometry |
164 | R13 | boundary | administrative | 4 | Berlin | city |poly-area:0.1 |
166 | osm | class | type | name | geometry |
167 | N2 | place | city | Berlin | 0.006 0.00001 |
170 | object | linked_place_id |
173 | object | rank_address |
175 When searching for ""
179 | ID | osm_type | osm_id |
181 When searching for ""
185 | ID | osm_type | osm_id |
189 Scenario: Boundaries without place tags only link against same admin level
191 | osm | class | type | admin | name | geometry |
192 | R13 | boundary | administrative | 4 | Berlin |poly-area:0.1 |
194 | osm | class | type | name | geometry |
195 | N2 | place | city | Berlin | 0.006 0.00001 |
198 | object | linked_place_id |
201 | object | rank_address |
203 When searching for ""
207 | ID | osm_type | osm_id |
209 When searching for ""
213 | ID | osm_type | osm_id |
217 Scenario: Do not use linked centroid when it is outside the area
218 Given the named places
219 | osm | class | type | admin | geometry |
220 | R13 | boundary | administrative | 4 | poly-area:0.01 |
222 | osm | class | type | geometry |
223 | N2 | place | city | 0.1 0.1 |
225 | id | members | tags+type |
226 | 13 | N2:label | boundary |
229 | object | linked_place_id |
232 | object | centroid |
233 | R13 | in geometry |