]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/update/simple.feature
bdd: move update tests from scenes to grid descriptions
[nominatim.git] / test / bdd / db / update / simple.feature
1 @DB
2 Feature: Update of simple objects
3     Testing simple updating functionality
4
5     Scenario: Do delete small boundary features
6         Given the 1.0 grid
7           | 1 | 2 |
8           | 4 | 3 |
9         Given the places
10           | osm | class    | type           | admin | geometry |
11           | R1  | boundary | administrative | 3     | (1,2,3,4,1) |
12         When importing
13         Then placex contains
14           | object | rank_search |
15           | R1     | 6 |
16         When marking for delete R1
17         Then placex has no entry for R1
18
19     Scenario: Do not delete large boundary features
20         Given the 2.0 grid
21           | 1 | 2 |
22           | 4 | 3 |
23         Given the places
24           | osm | class    | type           | admin | geometry |
25           | R1  | boundary | administrative | 3     | (1,2,3,4,1) |
26         When importing
27         Then placex contains
28           | object | rank_search |
29           | R1     | 6 |
30         When marking for delete R1
31         Then placex contains
32           | object | rank_search |
33           | R1     | 6 |
34
35     Scenario: Do delete large features of low rank
36         Given the 2.0 grid
37           | 1 | 2 |
38           | 4 | 3 |
39         Given the named places
40           | osm | class    | type        | geometry |
41           | W1  | place    | house       | (1,2,3,4,1) |
42           | R1  | natural  | wood        | (1,2,3,4,1) |
43           | R2  | highway  | residential | (1,2,3,4,1) |
44         When importing
45         Then placex contains
46           | object | rank_address |
47           | R1     | 0 |
48           | R2     | 26 |
49           | W1     | 30 |
50         When marking for delete R1,R2,W1
51         Then placex has no entry for W1
52         Then placex has no entry for R1
53         Then placex has no entry for R2
54
55     Scenario: type mutation
56         Given the places
57           | osm | class | type | geometry |
58           | N3  | shop  | toys | 1 -1 |
59         When importing
60         Then placex contains
61           | object | class | type | centroid |
62           | N3     | shop  | toys | 1 -1 |
63         When updating places
64           | osm | class | type    | geometry |
65           | N3  | shop  | grocery | 1 -1 |
66         Then placex contains
67           | object | class | type    | centroid |
68           | N3     | shop  | grocery | 1 -1 |
69
70     Scenario: remove postcode place when house number is added
71         Given the places
72           | osm | class | type     | postcode | geometry |
73           | N3  | place | postcode | 12345    | country:de |
74         When importing
75         Then placex has no entry for N3
76         When updating places
77           | osm | class | type  | postcode | housenr | geometry |
78           | N3  | place | house | 12345    | 13      | country:de |
79         Then placex contains
80           | object | class | type |
81           | N3     | place | house |
82
83     Scenario: remove boundary when changing from polygon to way
84         Given the grid
85           | 1 | 2 |
86           | 3 | 4 |
87         And the places
88           | osm | class    | type           | name | admin | geometry        |
89           | W1  | boundary | administrative | Haha | 5     | (1, 2, 4, 3, 1) |
90         When importing
91         Then placex contains
92           | object |
93           | W1 |
94         When updating places
95           | osm | class    | type           | name | admin | geometry   |
96           | W1  | boundary | administrative | Haha | 5     | 1, 2, 4, 3 |
97         Then placex has no entry for W1
98
99      #895
100      Scenario: update rank when boundary is downgraded from admin to historic
101         Given the grid
102           | 1 | 2 |
103           | 3 | 4 |
104         And the places
105           | osm | class    | type           | name | admin | geometry        |
106           | W1  | boundary | administrative | Haha | 5     | (1, 2, 4, 3, 1) |
107         When importing
108         Then placex contains
109           | object | rank_address |
110           | W1     | 10           |
111         When updating places
112           | osm | class    | type           | name | admin | geometry        |
113           | W1  | boundary | historic       | Haha | 5     | (1, 2, 4, 3, 1) |
114         Then placex contains
115           | object | rank_address |
116           | W1     | 0            |