1 Feature: Linking of places
2 Tests for correctly determining linked places
4 Scenario: Only address-describing places can be linked
10 | osm | class | type | name | geometry |
11 | R13 | landuse | forest | Garbo | (1,2,3,4,1) |
12 | N256 | natural | peak | Garbo | 9 |
15 | object | linked_place_id |
19 Scenario: Waterways are linked when in waterway relations
21 | 1 | | | | 3 | 4 | | | | 6 |
22 | | | 2 | | | 10 | | 5 | | |
23 | | | | | | 11 | | | | |
25 | osm | class | type | name | geometry |
26 | W1 | waterway | river | Rhein | 1,2,3 |
27 | W2 | waterway | river | Rhein | 3,4,5 |
28 | R13 | waterway | river | Rhein | 1,2,3,4,5,6 |
29 | R23 | waterway | river | Limmat| 4,10,11 |
31 | id | members | tags+type |
32 | 13 | R23:tributary,W1,W2:main_stream | waterway |
35 | object | linked_place_id |
40 When geocoding "rhein"
41 Then the result set contains
45 Scenario: Relations are not linked when in waterway relations
47 | 1 | | | | 3 | 4 | | | | 6 |
48 | | | 2 | | | 10 | | 5 | | |
49 | | | | | | 11 | | | | |
51 | osm | class | type | name | geometry |
52 | W1 | waterway | stream | Rhein | 1,2,3,4 |
53 | W2 | waterway | river | Rhein | 4,5,6 |
54 | R1 | waterway | river | Rhein | 1,2,3,4 |
55 | R2 | waterway | river | Limmat| 4,10,11 |
57 | id | members | tags+type |
61 | object | linked_place_id |
66 When geocoding "rhein"
67 Then result 0 contains
75 Scenario: Empty waterway relations are handled correctly
79 | osm | class | type | name | geometry |
80 | R1 | waterway | river | Rhein | 1,3 |
82 | id | members | tags+type |
86 | object | linked_place_id |
89 Scenario: Waterways are not linked when the way type is not a river feature
95 | osm | class | type | name | geometry |
96 | W1 | waterway | lock | Rhein | 3,4 |
97 | R1 | landuse | meadow | Rhein | (3,1,2,4,3) |
99 | id | members | tags+type |
100 | 1 | W1,W2 | multipolygon |
103 | object | linked_place_id |
107 Scenario: Side streams are linked only when they have the same name
110 | 1 | | 2 | 3 | | 4 | 5 | 6|
113 | osm | class | type | name | geometry |
114 | W1 | waterway | river | Rhein2 | 2,8,4 |
115 | W2 | waterway | river | Rhein | 3,9,5 |
116 | R1 | waterway | river | Rhein | 1,2,3,4,5,6 |
118 | id | members | tags+type |
119 | 1 | W1:side_stream,W2:side_stream,W3 | waterway |
122 | object | linked_place_id |
125 When geocoding "rhein2"
126 Then the result set contains
131 Scenario: Boundaries should only be linked to places
136 Given the named places
137 | osm | class | type | extra+wikidata | admin | geometry |
138 | R1 | boundary | administrative | 34 | 8 | (1,2,3,4,1) |
140 | osm | class | type |
141 | N9 | natural | island |
142 | N9 | place | city |
148 | object | linked_place_id |
152 Scenario: Nodes with 'role' label are always linked
158 | osm | class | type | admin | name | geometry |
159 | R13 | boundary | administrative | 6 | Garbo | (1,2,3,4,1) |
160 | N2 | place | hamlet | 15 | Vario | 9 |
162 | id | members | tags+type |
163 | 13 | N2:label | boundary |
166 | object | linked_place_id |
169 | object | centroid!wkt | name+name | extratags+linked_place |
170 | R13 | 9 | Garbo | hamlet |
172 Scenario: Boundaries with place tags are linked against places with same type
178 | osm | class | type | admin | name | extra+place | geometry |
179 | R13 | boundary | administrative | 4 | Berlin | city | (1,2,3,4,1) |
181 | osm | class | type | name | geometry |
182 | N2 | place | city | Berlin | 9 |
185 | object | linked_place_id |
188 | object | rank_address |
193 Then result 0 contains
199 Then result 0 contains
204 Scenario: Boundaries without place tags only link against same admin level
210 | osm | class | type | admin | name | geometry |
211 | R13 | boundary | administrative | 4 | Berlin | (1,2,3,4,1) |
213 | osm | class | type | name | geometry |
214 | N2 | place | city | Berlin | 9 |
217 | object | linked_place_id |
220 | object | rank_address |
225 Then result 0 contains
231 Then result 0 contains
236 Scenario: Do not use linked centroid when it is outside the area
241 Given the named places
242 | osm | class | type | admin | geometry |
243 | R13 | boundary | administrative | 4 | (1,2,3,4,1) |
245 | osm | class | type | geometry |
246 | N2 | place | city | 9 |
248 | id | members | tags+type |
249 | 13 | N2:label | boundary |
252 | object | linked_place_id |
255 | object | centroid!in_box |
256 | R13 | 0,0,0.1,0.1 |
258 Scenario: Place nodes can only be linked once
263 Given the named places
264 | osm | class | type | extra+wikidata | geometry |
265 | N2 | place | city | Q1234 | 9 |
267 | osm | class | type | extra+wikidata | admin | geometry |
268 | R1 | boundary | administrative | Q1234 | 8 | (1,2,5,6,3,4,1) |
269 | R2 | boundary | administrative | Q1234 | 9 | (1,2,3,4,1) |
272 | object | linked_place_id |
275 | object | extratags!dict |
276 | R1 | 'linked_place' : 'city', 'wikidata': 'Q1234' |
277 | R2 | 'wikidata': 'Q1234' |
280 Scenario: Boundaries without names inherit names from linked places
286 | osm | class | type | extra+wikidata | admin | geometry |
287 | R1 | boundary | administrative | 34 | 8 | (1,2,3,4,1) |
289 | osm | class | type | name+name |
290 | N9 | place | city | LabelPlace |
296 | object | name+_place_name |
301 Scenario: Linked places expand default language names
307 | osm | class | type | name+name | geometry |
308 | N9 | place | city | Popayán | 9 |
309 | R1 | boundary | administrative | Perímetro Urbano Popayán | (1,2,3,4,1) |
315 | object | name+_place_name | name+_place_name:es |
316 | R1 | Popayán | Popayán |