]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/update/linked_places.feature
Merge branch 'patch-1' of https://github.com/ganeshkrishnan1/Nominatim into ganeshkri...
[nominatim.git] / test / bdd / db / update / linked_places.feature
1 @DB
2 Feature: Updates of linked places
3     Tests that linked places are correctly added and deleted.
4
5     Scenario: Add linked place when linking relation is renamed
6         Given the places
7             | osm | class | type | name | geometry |
8             | N1  | place | city | foo  | 0 0 |
9         And the places
10             | osm | class    | type           | name | admin | geometry |
11             | R1  | boundary | administrative | foo  | 8     | poly-area:0.1 |
12         When importing
13         And searching for "foo" with dups
14         Then results contain
15          | osm_type |
16          | R |
17         When updating places
18          | osm | class    | type           | name   | admin | geometry |
19          | R1  | boundary | administrative | foobar | 8     | poly-area:0.1 |
20         Then placex contains
21          | object | linked_place_id |
22          | N1     | - |
23         When searching for "foo" with dups
24         Then results contain
25          | osm_type |
26          | N |
27
28     Scenario: Add linked place when linking relation is removed
29         Given the places
30             | osm | class | type | name | geometry |
31             | N1  | place | city | foo  | 0 0 |
32         And the places
33             | osm | class    | type           | name | admin | geometry |
34             | R1  | boundary | administrative | foo  | 8     | poly-area:0.1 |
35         When importing
36         And searching for "foo" with dups
37         Then results contain
38          | osm_type |
39          | R |
40         When marking for delete R1
41         Then placex contains
42          | object | linked_place_id |
43          | N1     | - |
44         When searching for "foo" with dups
45         Then results contain
46          | osm_type |
47          | N |
48
49     Scenario: Remove linked place when linking relation is added
50         Given the places
51             | osm | class | type | name | geometry |
52             | N1  | place | city | foo  | 0 0 |
53         When importing
54         And searching for "foo" with dups
55         Then results contain
56          | osm_type |
57          | N |
58         When updating places
59          | osm | class    | type           | name   | admin | geometry |
60          | R1  | boundary | administrative | foo    | 8     | poly-area:0.1 |
61         Then placex contains
62          | object | linked_place_id |
63          | N1     | R1 |
64         When searching for "foo" with dups
65         Then results contain
66          | osm_type |
67          | R |
68
69     Scenario: Remove linked place when linking relation is renamed
70         Given the places
71             | osm | class | type | name | geometry |
72             | N1  | place | city | foo  | 0 0 |
73         And the places
74          | osm | class    | type           | name   | admin | geometry |
75          | R1  | boundary | administrative | foobar | 8     | poly-area:0.1 |
76         When importing
77         And searching for "foo" with dups
78         Then results contain
79          | osm_type |
80          | N |
81         When updating places
82          | osm | class    | type           | name   | admin | geometry |
83          | R1  | boundary | administrative | foo    | 8     | poly-area:0.1 |
84         Then placex contains
85          | object | linked_place_id |
86          | N1     | R1 |
87         When searching for "foo" with dups
88         Then results contain
89          | osm_type |
90          | R |
91
92     Scenario: Update linking relation when linkee name is updated
93         Given the places
94          | osm | class    | type           | name | admin | geometry |
95          | R1  | boundary | administrative | rel  | 8     | poly-area:0.1 |
96         And the places
97          | osm | class    | type        | name+name:de | admin | geometry |
98          | N3  | place    | city           | pnt  | 30    | 0.00001 0 |
99         And the relations
100          | id | members  |
101          | 1  | N3:label |
102         When importing
103         Then placex contains
104          | object | linked_place_id | name+name:de |
105          | R1     | -               | pnt  |
106          | N3     | R1              | pnt  |
107         When updating places
108          | osm | class    | type        | name+name:de | admin | geometry |
109          | N3  | place    | city        | newname  | 30    | 0.00001 0 |
110         Then placex contains
111          | object | linked_place_id | name+name:de |
112          | N3     | R1              | newname  |
113          | R1     | -               | newname  |
114
115     Scenario: Updating linkee extratags keeps linker's extratags
116         Given the named places
117          | osm | class    | type           | extra+wikidata | admin | geometry |
118          | R1  | boundary | administrative | 34             | 8     | poly-area:0.1 |
119         And the named places
120          | osm | class    | type           | geometry |
121          | N3  | place    | city           | 0.00001 0 |
122         And the relations
123          | id | members  |
124          | 1  | N3:label |
125         When importing
126         Then placex contains
127          | object | extratags |
128          | R1     | 'wikidata' : '34', 'linked_place' : 'city' |
129         When updating places
130          | osm | class    | type        | name    | extra+oneway | admin | geometry |
131          | N3  | place    | city        | newname | yes          | 30    | 0.00001 0 |
132         Then placex contains
133          | object | extratags |
134          | R1     | 'wikidata' : '34', 'oneway' : 'yes', 'linked_place' : 'city' |
135