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