]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/import/addressing.feature
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / test / bdd / db / import / addressing.feature
1 @DB
2 Feature: Address computation
3     Tests for filling of place_addressline
4
5     # github #121
6     Scenario: Roads crossing boundaries should contain both states
7         Given the grid
8             | 1 |   |   | 2 |   | 3 |
9             |   | 7 |   |   | 8 |   |
10             | 4 |   |   | 5 |   | 6 |
11         And the named places
12             | osm | class   | type | geometry |
13             | W1  | highway | road | 7, 8     |
14         And the named places
15             | osm | class    | type           | admin | geometry      |
16             | W10 | boundary | administrative | 5     | (1, 2, 5, 4, 1) |
17             | W11 | boundary | administrative | 5     | (2, 3, 6, 5, 2) |
18         When importing
19         Then place_addressline contains
20             | object | address | cached_rank_address |
21             | W1     | W10     | 10                  |
22             | W1     | W11     | 10                  |
23
24
25     Scenario: Roads following a boundary should contain both states
26         Given the grid
27             | 1 |   |   | 2 |   | 3 |
28             |   |   | 8 | 7 |   |   |
29             | 4 |   |   | 5 |   | 6 |
30         And the named places
31             | osm | class   | type | geometry |
32             | W1  | highway | road | 2, 7, 8  |
33         And the named places
34             | osm | class    | type           | admin | geometry      |
35             | W10 | boundary | administrative | 5     | (1, 2, 5, 4, 1) |
36             | W11 | boundary | administrative | 5     | (2, 3, 6, 5, 2) |
37         When importing
38         Then place_addressline contains
39             | object | address | cached_rank_address |
40             | W1     | W10     | 10                  |
41             | W1     | W11     | 10                  |
42
43     Scenario: Roads should not contain boundaries they touch in a end point
44         Given the grid
45             | 1 |   |   | 2 |   | 3 |
46             |   | 7 |   | 8 |   |   |
47             | 4 |   |   | 5 |   | 6 |
48         And the named places
49             | osm | class   | type | geometry |
50             | W1  | highway | road | 7, 8     |
51         And the named places
52             | osm | class    | type           | admin | geometry      |
53             | W10 | boundary | administrative | 5     | (1, 2, 8, 5, 4, 1) |
54             | W11 | boundary | administrative | 5     | (2, 3, 6, 5, 8, 2) |
55         When importing
56         Then place_addressline contains
57             | object | address | cached_rank_address |
58             | W1     | W10     | 10                  |
59         Then place_addressline doesn't contain
60             | object | address |
61             | W1     | W11     |
62
63     Scenario: Roads should not contain boundaries they touch in a end point
64         Given the grid
65             | 1 |   |   | 2 |   | 3 |
66             |   | 7 |   | 8 |   |   |
67             | 4 |   | 9 | 5 |   | 6 |
68         And the named places
69             | osm | class   | type | geometry |
70             | W1  | highway | road | 7, 8, 9     |
71         And the named places
72             | osm | class    | type           | admin | geometry      |
73             | W10 | boundary | administrative | 5     | (1, 2, 8, 5, 4, 1) |
74             | W11 | boundary | administrative | 5     | (2, 3, 6, 5, 8, 2) |
75         When importing
76         Then place_addressline contains
77             | object | address | cached_rank_address |
78             | W1     | W10     | 10                  |
79         Then place_addressline doesn't contain
80             | object | address |
81             | W1     | W11     |
82
83     Scenario: Locality points should contain all boundaries they touch
84         Given the 0.001 grid
85             | 1 |   |   | 2 |   | 3 |
86             |   |   |   | 8 |   |   |
87             | 4 |   |   | 5 |   | 6 |
88         And the named places
89             | osm | class | type     | geometry |
90             | N1  | place | locality | 8        |
91         And the named places
92             | osm | class    | type           | admin | geometry      |
93             | W10 | boundary | administrative | 5     | (1, 2, 8, 5, 4, 1) |
94             | W11 | boundary | administrative | 5     | (2, 3, 6, 5, 8, 2) |
95         When importing
96         Then place_addressline contains
97             | object | address | cached_rank_address |
98             | N1     | W10     | 10                  |
99             | N1     | W11     | 10                  |
100
101     Scenario: Areas should not contain boundaries they touch
102         Given the grid
103             | 1 |   |   | 2 |   | 3 |
104             |   |   |   |   |   |   |
105             | 4 |   |   | 5 |   | 6 |
106         And the named places
107             | osm | class    | type           | geometry      |
108             | W1  | landuse  | industrial     | (1, 2, 5, 4, 1) |
109         And the named places
110             | osm | class    | type           | admin | geometry      |
111             | W10 | boundary | administrative | 5     | (2, 3, 6, 5, 2) |
112         When importing
113         Then place_addressline doesn't contain
114             | object | address |
115             | W1     | W10     |
116
117     Scenario: buildings with only addr:postcodes do not appear in the address of a way
118         Given the scene admin-areas
119         And the named places
120             | osm | class    | type           | admin | addr+postcode | geometry |
121             | R1  | boundary | administrative | 6     | 112           | :b0      |
122             | R34 | boundary | administrative | 8     | 112 DE        | :b1:E    |
123             | R4  | boundary | administrative | 10    | 112 DE 34     | :b2:N    |
124         And the named places
125             | osm | class    | type           | geometry |
126             | W93 | highway  | residential    | :w2N     |
127         And the places
128             | osm | class    | type        | addr+postcode | geometry |
129             | W22 | place    | postcode    | 445023        | :building:w2N |
130         When importing
131         Then place_addressline doesn't contain
132             | object | address  |
133             | W93    | W22      |
134
135     Scenario: postcode boundaries do appear in the address of a way
136         Given the scene admin-areas
137         And the named places
138             | osm | class    | type           | admin | addr+postcode | geometry |
139             | R1  | boundary | administrative | 6     | 112           | :b0      |
140             | R34 | boundary | administrative | 8     | 112 DE        | :b1:E    |
141         And the places
142             | osm | class    | type      | addr+postcode | geometry |
143             | R4  | place    | postcode  | 112 DE 34     | :b2:N    |
144         And the named places
145             | osm | class    | type           | geometry |
146             | W93 | highway  | residential    | :w2N     |
147         And the places
148             | osm | class    | type        | addr+postcode | geometry |
149             | W22 | place    | postcode    | 445023        | :building:w2N |
150         When importing
151         Then place_addressline contains
152             | object | address |
153             | W93    | R4      |