]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/update/addressing.feature
prepare release 5.3.2.post2
[nominatim.git] / test / bdd / features / db / update / addressing.feature
1 Feature: Updates for address computation
2     Tests for correctly updating address assignments on changes.
3
4     Scenario: Address gets updated when an area is extended
5         Given the 0.0001 grid
6             | 1 |   | 2 |   | 3 |   | 4 |
7             |   |   |   | 9 |   |   |   |
8             | 8 |   | 7 |   | 6 |   | 5 |
9         And the places
10             | osm | class    | type           | admin | name | geometry    |
11             | R1  | boundary | administrative | 6     | Fooo | (1,4,5,8,1) |
12             | R2  | boundary | administrative | 8     | Barr | (3,4,5,6,3) |
13         And the named places
14             | osm | class | type   | geometry |
15             | N1  | place | suburb | 9        |
16         When importing
17         Then place_addressline contains exactly
18             | object | address |
19             | N1     | R1      |
20             | R2     | R1      |
21
22         When updating places
23             | osm | class    | type           | admin | name | geometry    |
24             | R2  | boundary | administrative | 8     | Barr | (2,4,5,7,2) |
25         Then place_addressline contains exactly
26             | object | address |
27             | N1     | R1      |
28             | N1     | R2      |
29             | R2     | R1      |
30
31     Scenario: Address gets updated when an area is reduced
32         Given the 0.0001 grid
33             | 1 |   | 2 |   | 3 |   | 4 |
34             |   |   |   | 9 |   |   |   |
35             | 8 |   | 7 |   | 6 |   | 5 |
36         And the places
37             | osm | class    | type           | admin | name | geometry    |
38             | R1  | boundary | administrative | 6     | Fooo | (1,4,5,8,1) |
39             | R2  | boundary | administrative | 8     | Barr | (2,4,5,7,2) |
40         And the named places
41             | osm | class | type   | geometry |
42             | N1  | place | suburb | 9        |
43         When importing
44         Then place_addressline contains exactly
45             | object | address |
46             | N1     | R1      |
47             | N1     | R2      |
48             | R2     | R1      |
49
50         When updating places
51             | osm | class    | type           | admin | name | geometry    |
52             | R2  | boundary | administrative | 8     | Barr | (3,4,5,6,3) |
53         Then place_addressline contains exactly
54             | object | address |
55             | N1     | R1      |
56             | R2     | R1      |
57
58     Scenario: Address gets updated when an area disappears
59         Given the 0.0001 grid
60             | 1 |   | 2 |   | 3 |   | 4 |
61             |   |   |   | 9 |   |   |   |
62             | 8 |   | 7 |   | 6 |   | 5 |
63         And the places
64             | osm | class    | type           | admin | name | geometry    |
65             | R1  | boundary | administrative | 6     | Fooo | (1,4,5,8,1) |
66             | R2  | boundary | administrative | 8     | Barr | (2,4,5,7,2) |
67         And the named places
68             | osm | class | type   | geometry |
69             | N1  | place | suburb | 9        |
70         When importing
71         Then place_addressline contains exactly
72             | object | address |
73             | N1     | R1      |
74             | N1     | R2      |
75             | R2     | R1      |
76
77         When updating places
78             | osm | class    | type           | admin | name | geometry    |
79             | R2  | boundary | administrative | 15    | Barr | (2,4,5,7,2) |
80         Then place_addressline contains exactly
81             | object | address |
82             | N1     | R1      |
83             | R2     | R1      |
84             | R2     | N1      |
85
86     Scenario: Address gets updated when the admin level changes
87         Given the 0.0001 grid
88             | 1 |   | 2 |   | 3 |   | 4 |
89             |   |   |   | 9 |   |   |   |
90             | 8 |   | 7 |   | 6 |   | 5 |
91         And the places
92             | osm | class    | type           | admin | name | geometry    |
93             | R1  | boundary | administrative | 6     | Fooo | (1,4,5,8,1) |
94             | R2  | boundary | administrative | 8     | Barr | (2,4,5,7,2) |
95         And the named places
96             | osm | class | type   | geometry |
97             | N1  | place | suburb | 9        |
98         When importing
99         Then place_addressline contains exactly
100             | object | address | cached_rank_address |
101             | N1     | R1      | 12 |
102             | N1     | R2      | 16 |
103             | R2     | R1      | 12 |
104
105         When updating places
106             | osm | class    | type           | admin | name | geometry    |
107             | R1  | boundary | administrative | 5     | Fooo | (1,4,5,8,1) |
108         Then place_addressline contains exactly
109             | object | address | cached_rank_address |
110             | N1     | R1      | 10 |
111             | N1     | R2      | 16 |
112             | R2     | R1      | 10 |