]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/db/update/interpolation.feature
Merge pull request #447 from lonvia/fix-array-expression
[nominatim.git] / tests / features / db / update / interpolation.feature
1 @DB
2 Feature: Update of address interpolations
3     Test the interpolated address are updated correctly
4
5     Scenario: addr:street added to interpolation
6       Given the scene parallel-road
7       And the place nodes
8           | osm_id | class | type  | housenumber | geometry
9           | 1      | place | house | 2           | :n-middle-w
10           | 2      | place | house | 6           | :n-middle-e
11       And the place ways
12           | osm_id | class   | type    | housenumber | geometry
13           | 10     | place   | houses  | even        | :w-middle
14       And the place ways
15           | osm_id | class   | type         | name                    | geometry
16           | 2      | highway | unclassified | 'name' : 'Sun Way'      | :w-north
17           | 3      | highway | unclassified | 'name' : 'Cloud Street' | :w-south
18       And the ways
19           | id  | nodes
20           | 10  | 1,100,101,102,2
21       When importing
22       Then table placex contains
23           | object | parent_place_id
24           | N1     | W2
25           | N2     | W2
26           | W10    | W2
27       And way 10 expands exactly to housenumbers 4
28       When updating place ways
29           | osm_id | class   | type    | housenumber | street       | geometry
30           | 10     | place   | houses  | even        | Cloud Street | :w-middle
31       Then way 10 expands exactly to housenumbers 4
32       And table placex contains
33           | object | parent_place_id
34           | N1     | W3
35           | N2     | W3
36           | W10    | W3
37
38     @Fail
39     Scenario: addr:street added to housenumbers
40       Given the scene parallel-road
41       And the place nodes
42           | osm_id | class | type  | housenumber | geometry
43           | 1      | place | house | 2           | :n-middle-w
44           | 2      | place | house | 6           | :n-middle-e
45       And the place ways
46           | osm_id | class   | type    | housenumber | geometry
47           | 10     | place   | houses  | even        | :w-middle
48       And the place ways
49           | osm_id | class   | type         | name                    | geometry
50           | 2      | highway | unclassified | 'name' : 'Sun Way'      | :w-north
51           | 3      | highway | unclassified | 'name' : 'Cloud Street' | :w-south
52       And the ways
53           | id  | nodes
54           | 10  | 1,100,101,102,2
55       When importing
56       Then table placex contains
57           | object | parent_place_id
58           | N1     | W2
59           | N2     | W2
60           | W10    | W2
61       And way 10 expands exactly to housenumbers 4
62       When updating place nodes
63           | osm_id | class | type  | street      | housenumber | geometry
64           | 1      | place | house | Cloud Street| 2           | :n-middle-w
65           | 2      | place | house | Cloud Street| 6           | :n-middle-e
66       Then way 10 expands exactly to housenumbers 4
67       And table placex contains
68           | object | parent_place_id
69           | N1     | W3
70           | N2     | W3
71           | W10    | W3
72
73
74     Scenario: interpolation tag removed
75       Given the scene parallel-road
76       And the place nodes
77           | osm_id | class | type  | housenumber | geometry
78           | 1      | place | house | 2           | :n-middle-w
79           | 2      | place | house | 6           | :n-middle-e
80       And the place ways
81           | osm_id | class   | type    | housenumber | geometry
82           | 10     | place   | houses  | even        | :w-middle
83       And the place ways
84           | osm_id | class   | type         | name                    | geometry
85           | 2      | highway | unclassified | 'name' : 'Sun Way'      | :w-north
86           | 3      | highway | unclassified | 'name' : 'Cloud Street' | :w-south
87       And the ways
88           | id  | nodes
89           | 10  | 1,100,101,102,2
90       When importing
91       Then table placex contains
92           | object | parent_place_id
93           | N1     | W2
94           | N2     | W2
95           | W10    | W2
96       And way 10 expands exactly to housenumbers 4
97       When marking for delete W10
98       Then way 10 expands to no housenumbers
99       And table placex contains
100           | object | parent_place_id
101           | N1     | W2
102           | N2     | W2
103
104
105     Scenario: referenced road added
106       Given the scene parallel-road
107       And the place nodes
108           | osm_id | class | type  | housenumber | geometry
109           | 1      | place | house | 2           | :n-middle-w
110           | 2      | place | house | 6           | :n-middle-e
111       And the place ways
112           | osm_id | class   | type    | housenumber | street      | geometry
113           | 10     | place   | houses  | even        | Cloud Street| :w-middle
114       And the place ways
115           | osm_id | class   | type         | name                    | geometry
116           | 2      | highway | unclassified | 'name' : 'Sun Way'      | :w-north
117       And the ways
118           | id  | nodes
119           | 10  | 1,100,101,102,2
120       When importing
121       Then table placex contains
122           | object | parent_place_id
123           | N1     | W2
124           | N2     | W2
125           | W10    | W2
126       And way 10 expands exactly to housenumbers 4
127       When updating place ways
128           | osm_id | class   | type         | name                    | geometry
129           | 3      | highway | unclassified | 'name' : 'Cloud Street' | :w-south
130       Then way 10 expands exactly to housenumbers 4
131       And table placex contains
132           | object | parent_place_id
133           | N1     | W3
134           | N2     | W3
135           | W10    | W3
136
137
138     Scenario: referenced road deleted
139       Given the scene parallel-road
140       And the place nodes
141           | osm_id | class | type  | housenumber | geometry
142           | 1      | place | house | 2           | :n-middle-w
143           | 2      | place | house | 6           | :n-middle-e
144       And the place ways
145           | osm_id | class   | type    | housenumber | street      | geometry
146           | 10     | place   | houses  | even        | Cloud Street| :w-middle
147       And the place ways
148           | osm_id | class   | type         | name                    | geometry
149           | 2      | highway | unclassified | 'name' : 'Sun Way'      | :w-north
150           | 3      | highway | unclassified | 'name' : 'Cloud Street' | :w-south
151       And the ways
152           | id  | nodes
153           | 10  | 1,100,101,102,2
154       When importing
155       Then table placex contains
156           | object | parent_place_id
157           | N1     | W3
158           | N2     | W3
159           | W10    | W3
160       And way 10 expands exactly to housenumbers 4
161       When marking for delete W3
162       Then way 10 expands exactly to housenumbers 4
163       And table placex contains
164           | object | parent_place_id
165           | N1     | W2
166           | N2     | W2
167           | W10    | W2