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: Waterways are linked when in waterway relations
18 Given the scene split-road
20 | osm | class | type | name | geometry |
21 | W1 | waterway | river | Rhein | :w-2 |
22 | W2 | waterway | river | Rhein | :w-3 |
23 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
24 | R23 | waterway | river | Limmat| :w-4a |
26 | id | members | tags+type |
27 | 13 | R23:tributary,W1,W2:main_stream | waterway |
30 | object | linked_place_id |
35 When searching for "rhein"
40 Scenario: Relations are not linked when in waterway relations
41 Given the scene split-road
43 | osm | class | type | name | geometry |
44 | W1 | waterway | stream | Rhein | :w-2 |
45 | W2 | waterway | river | Rhein | :w-3 |
46 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
47 | R2 | waterway | river | Limmat| :w-4a |
49 | id | members | tags+type |
53 | object | linked_place_id |
59 Scenario: Empty waterway relations are handled correctly
60 Given the scene split-road
62 | osm | class | type | name | geometry |
63 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
65 | id | members | tags+type |
69 | object | linked_place_id |
72 Scenario: Waterways are not linked when the way type is not a river feature
73 Given the scene split-road
75 | osm | class | type | name | geometry |
76 | W1 | waterway | lock | Rhein | :w-2 |
77 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
79 | id | members | tags+type |
80 | 1 | N23,N34,W1,R45 | multipolygon |
83 | object | linked_place_id |
86 When searching for "rhein"
92 Scenario: Side streams are linked only when they have the same name
93 Given the scene split-road
95 | osm | class | type | name | geometry |
96 | W1 | waterway | river | Rhein2 | :w-2 |
97 | W2 | waterway | river | Rhein | :w-3 |
98 | R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
100 | id | members | tags+type |
101 | 1 | W1:side_stream,W2:side_stream | waterway |
104 | object | linked_place_id |
107 When searching for "rhein2"
113 Scenario: Boundaries should only be linked to places
114 Given the named places
115 | osm | class | type | extra+wikidata | admin | geometry |
116 | R1 | boundary | administrative | 34 | 8 | poly-area:0.1 |
118 | osm | class | type | geometry |
119 | N3 | natural | island | 0.00001 0 |
120 | N3 | place | city | 0.00001 0 |
126 | object | linked_place_id |
130 Scenario: Nodes with 'role' label are always linked
132 | osm | class | type | admin | name | geometry |
133 | R13 | boundary | administrative | 6 | Garbo | poly-area:0.1 |
134 | N2 | place | hamlet | 15 | Vario | 0.006 0.00001 |
136 | id | members | tags+type |
137 | 13 | N2:label | boundary |
140 | object | linked_place_id |
143 | object | centroid | name+name | extratags+linked_place |
144 | R13 | 0.006 0.00001 | Garbo | hamlet |
146 Scenario: Boundaries with place tags are linked against places with same type
148 | osm | class | type | admin | name | extra+place | geometry |
149 | R13 | boundary | administrative | 4 | Berlin | city |poly-area:0.1 |
151 | osm | class | type | name | geometry |
152 | N2 | place | city | Berlin | 0.006 0.00001 |
155 | object | linked_place_id |
158 | object | rank_address |
160 When searching for ""
164 | ID | osm_type | osm_id |
166 When searching for ""
170 | ID | osm_type | osm_id |
174 Scenario: Boundaries without place tags only link against same admin level
176 | osm | class | type | admin | name | geometry |
177 | R13 | boundary | administrative | 4 | Berlin |poly-area:0.1 |
179 | osm | class | type | name | geometry |
180 | N2 | place | city | Berlin | 0.006 0.00001 |
183 | object | linked_place_id |
186 | object | rank_address |
188 When searching for ""
192 | ID | osm_type | osm_id |
194 When searching for ""
198 | ID | osm_type | osm_id |
202 Scenario: Do not use linked centroid when it is outside the area
203 Given the named places
204 | osm | class | type | admin | geometry |
205 | R13 | boundary | administrative | 4 | poly-area:0.01 |
207 | osm | class | type | geometry |
208 | N2 | place | city | 0.1 0.1 |
210 | id | members | tags+type |
211 | 13 | N2:label | boundary |
214 | object | linked_place_id |
217 | object | centroid |
218 | R13 | in geometry |