]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/db/import/linking.feature
travis: exclude poldi, waterway tests
[nominatim.git] / tests / features / 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 place areas
8          | osm_type | osm_id | class   | type   | name  | geometry
9          | R        | 13     | landuse | forest | Garbo | :area
10         And the place nodes
11          | osm_id | class   | type | name  | geometry
12          | 256    | natural | peak | Garbo | :inner-C
13         When importing
14         Then table placex contains
15          | object  | linked_place_id
16          | R13     | None
17          | N256    | None
18
19     @RiverRhein
20     Scenario: Waterways are linked when in waterway relations
21         Given the scene split-road
22         And the place ways
23          | osm_type | osm_id | class    | type  | name  | geometry
24          | W        | 1      | waterway | river | Rhein | :w-2
25          | W        | 2      | waterway | river | Rhein | :w-3
26          | R        | 13     | waterway | river | Rhein | :w-1 + :w-2 + :w-3
27          | R        | 23     | waterway | river | Limmat| :w-4a
28         And the relations
29          | id | members                          | tags
30          | 13 | R23:tributary,W1,W2:main_stream  | 'type' : 'waterway'
31         When importing
32         Then table placex contains
33          | object | linked_place_id
34          | W1     | R13
35          | W2     | R13
36          | R13    | None
37          | R23    | None
38         When sending query "rhein"
39         Then results contain
40          | osm_type
41          | R
42
43     @RiverRhein
44     Scenario: Relations are not linked when in waterway relations
45         Given the scene split-road
46         And the place ways
47          | osm_type | osm_id | class    | type  | name  | geometry
48          | W        | 1      | waterway | river | Rhein | :w-2
49          | W        | 2      | waterway | river | Rhein | :w-3
50          | R        | 1      | waterway | river | Rhein | :w-1 + :w-2 + :w-3
51          | R        | 2      | waterway | river | Limmat| :w-4a
52         And the relations
53          | id | members                          | tags
54          | 1  | R2                               | 'type' : 'waterway'
55         When importing
56         Then table placex contains
57          | object | linked_place_id
58          | W1     | None
59          | W2     | None
60          | R1     | None
61          | R2     | None
62
63     @RiverRhein
64     Scenario: Empty waterway relations are handled correctly
65         Given the scene split-road
66         And the place ways
67          | osm_type | osm_id | class    | type  | name  | geometry
68          | R        | 1      | waterway | river | Rhein | :w-1 + :w-2 + :w-3
69         And the relations
70          | id | members                          | tags
71          | 1 |                                  | 'type' : 'waterway'
72         When importing
73         Then table placex contains
74          | object | linked_place_id
75          | R1     | None
76
77     @RiverRhein
78     Scenario: Waterways are not linked when waterway types don't match
79         Given the scene split-road
80         And the place ways
81          | osm_type | osm_id | class    | type     | name  | geometry
82          | W        | 1      | waterway | drain    | Rhein | :w-2
83          | R        | 1      | waterway | river    | Rhein | :w-1 + :w-2 + :w-3
84         And the relations
85          | id | members               | tags
86          | 1  | N23,N34,W1,R45        | 'type' : 'multipolygon'
87         When importing
88         Then table placex contains
89          | object | linked_place_id
90          | W1     | None
91          | R1     | None
92         When sending query "rhein"
93         Then results contain
94           | ID | osm_type
95           |  0 | R
96           |  1 | W
97
98     @RiverRhein
99     Scenario: Side streams are linked only when they have the same name
100         Given the scene split-road
101         And the place ways
102          | osm_type | osm_id | class    | type  | name   | geometry
103          | W        | 1      | waterway | river | Rhein2 | :w-2
104          | W        | 2      | waterway | river | Rhein  | :w-3
105          | R        | 1      | waterway | river | Rhein  | :w-1 + :w-2 + :w-3
106         And the relations
107          | id | members                           | tags
108          | 1  | W1:side_stream,W2:side_stream     | 'type' : 'waterway'
109         When importing
110         Then table placex contains
111          | object | linked_place_id
112          | W1     | None
113          | W2     | R1
114         When sending query "rhein2"
115         Then results contain
116          | osm_type
117          | W