]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/import/linking.feature
tests for linking
[nominatim.git] / test / bdd / db / import / linking.feature
1 @DB
2 Feature: Linking of places
3     Tests for correctly determining linked places
4
5     Scenario: Only address-describing places can be linked
6         Given the scene way-area-with-center
7         And the places
8          | osm  | class   | type   | name  | geometry |
9          | R13  | landuse | forest | Garbo | :area |
10          | N256 | natural | peak   | Garbo | :inner-C |
11         When importing
12         Then placex contains
13          | object  | linked_place_id |
14          | R13     | - |
15          | N256    | - |
16
17     Scenario: Waterways are linked when in waterway relations
18         Given the scene split-road
19         And the places
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 |
25         And the relations
26          | id | members                          | tags+type |
27          | 13 | R23:tributary,W1,W2:main_stream  | waterway |
28         When importing
29         Then placex contains
30          | object | linked_place_id |
31          | W1     | R13 |
32          | W2     | R13 |
33          | R13    | -   |
34          | R23    | -   |
35         When searching for "rhein"
36         Then results contain
37          | osm_type |
38          | R |
39
40     Scenario: Relations are not linked when in waterway relations
41         Given the scene split-road
42         And the places
43          | osm | class    | type  | name  | geometry |
44          | W1  | waterway | river | 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 |
48         And the relations
49          | id | members                          | tags+type |
50          | 1  | R2                               | waterway  |
51         When importing
52         Then placex contains
53          | object | linked_place_id |
54          | W1     | - |
55          | W2     | - |
56          | R1     | - |
57          | R2     | - |
58
59     Scenario: Empty waterway relations are handled correctly
60         Given the scene split-road
61         And the places
62          | osm | class    | type  | name  | geometry |
63          | R1  | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
64         And the relations
65          | id | members  | tags+type |
66          | 1  |          | waterway |
67         When importing
68         Then placex contains
69          | object | linked_place_id |
70          | R1     | - |
71
72     Scenario: Waterways are not linked when waterway types don't match
73         Given the scene split-road
74         And the places
75          | osm | class    | type     | name  | geometry |
76          | W1  | waterway | drain    | Rhein | :w-2 |
77          | R1  | waterway | river    | Rhein | :w-1 + :w-2 + :w-3 |
78         And the relations
79          | id | members               | tags+type |
80          | 1  | N23,N34,W1,R45        | multipolygon |
81         When importing
82         Then placex contains
83          | object | linked_place_id |
84          | W1     | - |
85          | R1     | - |
86         When searching for "rhein"
87         Then results contain
88           | ID | osm_type |
89           |  0 | R |
90           |  1 | W |
91
92     Scenario: Side streams are linked only when they have the same name
93         Given the scene split-road
94         And the places
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 |
99         And the relations
100          | id | members                           | tags+type |
101          | 1  | W1:side_stream,W2:side_stream     | waterway |
102         When importing
103         Then placex contains
104          | object | linked_place_id |
105          | W1     | -  |
106          | W2     | R1 |
107         When searching for "rhein2"
108         Then results contain
109          | osm_type |
110          | W |