2 Feature: Linking of places
3 Tests for correctly determining linked places
5 Scenario: Only address-describing places can be linked
11 | osm | class | type | name | geometry |
12 | R13 | landuse | forest | Garbo | (1,2,3,4,1) |
13 | N256 | natural | peak | Garbo | 9 |
16 | object | linked_place_id |
20 Scenario: Postcode areas cannot be linked
21 Given the grid with origin US
26 | osm | class | type | addr+postcode | extra+wikidata | geometry |
27 | R13 | boundary | postal_code | 12345 | Q87493 | (1,2,3,4,1) |
28 | N25 | place | suburb | 12345 | Q87493 | 9 |
31 | object | linked_place_id |
35 Scenario: Waterways are linked when in waterway relations
37 | 1 | | | | 3 | 4 | | | | 6 |
38 | | | 2 | | | 10 | | 5 | | |
39 | | | | | | 11 | | | | |
41 | osm | class | type | name | geometry |
42 | W1 | waterway | river | Rhein | 1,2,3 |
43 | W2 | waterway | river | Rhein | 3,4,5 |
44 | R13 | waterway | river | Rhein | 1,2,3,4,5,6 |
45 | R23 | waterway | river | Limmat| 4,10,11 |
47 | id | members | tags+type |
48 | 13 | R23:tributary,W1,W2:main_stream | waterway |
51 | object | linked_place_id |
56 When sending search query "rhein"
61 Scenario: Relations are not linked when in waterway relations
63 | 1 | | | | 3 | 4 | | | | 6 |
64 | | | 2 | | | 10 | | 5 | | |
65 | | | | | | 11 | | | | |
67 | osm | class | type | name | geometry |
68 | W1 | waterway | stream | Rhein | 1,2,3,4 |
69 | W2 | waterway | river | Rhein | 4,5,6 |
70 | R1 | waterway | river | Rhein | 1,2,3,4 |
71 | R2 | waterway | river | Limmat| 4,10,11 |
73 | id | members | tags+type |
77 | object | linked_place_id |
82 When sending search query "rhein"
89 Scenario: Empty waterway relations are handled correctly
93 | osm | class | type | name | geometry |
94 | R1 | waterway | river | Rhein | 1,3 |
96 | id | members | tags+type |
100 | object | linked_place_id |
103 Scenario: Waterways are not linked when the way type is not a river feature
109 | osm | class | type | name | geometry |
110 | W1 | waterway | lock | Rhein | 3,4 |
111 | R1 | landuse | meadow | Rhein | (3,1,2,4,3) |
113 | id | members | tags+type |
114 | 1 | W1,W2 | multipolygon |
117 | object | linked_place_id |
121 Scenario: Side streams are linked only when they have the same name
124 | 1 | | 2 | 3 | | 4 | 5 | 6|
127 | osm | class | type | name | geometry |
128 | W1 | waterway | river | Rhein2 | 2,8,4 |
129 | W2 | waterway | river | Rhein | 3,9,5 |
130 | R1 | waterway | river | Rhein | 1,2,3,4,5,6 |
132 | id | members | tags+type |
133 | 1 | W1:side_stream,W2:side_stream,W3 | waterway |
136 | object | linked_place_id |
139 When sending search query "rhein2"
145 Scenario: Boundaries should only be linked to places
150 Given the named places
151 | osm | class | type | extra+wikidata | admin | geometry |
152 | R1 | boundary | administrative | 34 | 8 | (1,2,3,4,1) |
154 | osm | class | type |
155 | N9 | natural | island |
156 | N9 | place | city |
162 | object | linked_place_id |
166 Scenario: Nodes with 'role' label are always linked
172 | osm | class | type | admin | name | geometry |
173 | R13 | boundary | administrative | 6 | Garbo | (1,2,3,4,1) |
174 | N2 | place | hamlet | 15 | Vario | 9 |
176 | id | members | tags+type |
177 | 13 | N2:label | boundary |
180 | object | linked_place_id |
183 | object | centroid | name+name | extratags+linked_place |
184 | R13 | 9 | Garbo | hamlet |
186 Scenario: Boundaries with place tags are linked against places with same type
192 | osm | class | type | admin | name | extra+place | geometry |
193 | R13 | boundary | administrative | 4 | Berlin | city | (1,2,3,4,1) |
195 | osm | class | type | name | geometry |
196 | N2 | place | city | Berlin | 9 |
199 | object | linked_place_id |
202 | object | rank_address |
204 When sending search query ""
208 | ID | osm_type | osm_id |
210 When sending search query ""
214 | ID | osm_type | osm_id |
218 Scenario: Boundaries without place tags only link against same admin level
224 | osm | class | type | admin | name | geometry |
225 | R13 | boundary | administrative | 4 | Berlin | (1,2,3,4,1) |
227 | osm | class | type | name | geometry |
228 | N2 | place | city | Berlin | 9 |
231 | object | linked_place_id |
234 | object | rank_address |
236 When sending search query ""
240 | ID | osm_type | osm_id |
242 When sending search query ""
246 | ID | osm_type | osm_id |
250 Scenario: Do not use linked centroid when it is outside the area
255 Given the named places
256 | osm | class | type | admin | geometry |
257 | R13 | boundary | administrative | 4 | (1,2,3,4,1) |
259 | osm | class | type | geometry |
260 | N2 | place | city | 9 |
262 | id | members | tags+type |
263 | 13 | N2:label | boundary |
266 | object | linked_place_id |
269 | object | centroid |
270 | R13 | in geometry |
272 Scenario: Place nodes can only be linked once
277 Given the named places
278 | osm | class | type | extra+wikidata | geometry |
279 | N2 | place | city | Q1234 | 9 |
281 | osm | class | type | extra+wikidata | admin | geometry |
282 | R1 | boundary | administrative | Q1234 | 8 | (1,2,5,6,3,4,1) |
283 | R2 | boundary | administrative | Q1234 | 9 | (1,2,3,4,1) |
286 | object | linked_place_id |
289 | object | extratags |
290 | R1 | 'linked_place' : 'city', 'wikidata': 'Q1234' |
291 | R2 | 'wikidata': 'Q1234' |