2 Feature: Import of address interpolations
3 Tests that interpolated addresses are added correctly
5 Scenario: Simple even interpolation line with two points
7 | osm_id | osm_type | class | type | housenumber | geometry
8 | 1 | N | place | house | 2 | 1 1
9 | 2 | N | place | house | 6 | 1 1.001
11 | osm_id | osm_type | class | type | housenumber | geometry
12 | 1 | W | place | houses | even | 1 1, 1 1.001
17 Then way 1 expands to lines
18 | startnumber | endnumber | geometry
19 | 2 | 6 | 1 1, 1 1.001
21 Scenario: Backwards even two point interpolation line
23 | osm_id | class | type | housenumber | geometry
24 | 1 | place | house | 2 | 1 1
25 | 2 | place | house | 6 | 1 1.001
27 | osm_id | class | type | housenumber | geometry
28 | 1 | place | houses | even | 1 1.001, 1 1
33 Then way 1 expands to lines
34 | startnumber | endnumber | geometry
35 | 2 | 6 | 1 1, 1 1.001
37 Scenario: Simple odd two point interpolation
39 | osm_id | class | type | housenumber | geometry
40 | 1 | place | house | 1 | 1 1
41 | 2 | place | house | 11 | 1 1.001
43 | osm_id | class | type | housenumber | geometry
44 | 1 | place | houses | odd | 1 1, 1 1.001
49 Then way 1 expands to lines
50 | startnumber | endnumber | geometry
51 | 1 | 11 | 1 1, 1 1.001
53 Scenario: Simple all two point interpolation
55 | osm_id | class | type | housenumber | geometry
56 | 1 | place | house | 1 | 1 1
57 | 2 | place | house | 3 | 1 1.001
59 | osm_id | class | type | housenumber | geometry
60 | 1 | place | houses | all | 1 1, 1 1.001
65 Then way 1 expands to lines
66 | startnumber | endnumber | geometry
67 | 1 | 3 | 1 1, 1 1.001
69 Scenario: Even two point interpolation line with intermediate empty node
71 | osm_id | class | type | housenumber | geometry
72 | 1 | place | house | 2 | 1 1
73 | 2 | place | house | 10 | 1.001 1.001
75 | osm_id | class | type | housenumber | geometry
76 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
81 Then way 1 expands to lines
82 | startnumber | endnumber | geometry
83 | 2 | 10 | 1 1, 1 1.001, 1.001 1.001
85 Scenario: Even two point interpolation line with intermediate duplicated empty node
87 | osm_id | class | type | housenumber | geometry
88 | 1 | place | house | 2 | 1 1
89 | 2 | place | house | 10 | 1.001 1.001
91 | osm_id | class | type | housenumber | geometry
92 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
97 Then way 1 expands to lines
98 | startnumber | endnumber | geometry
99 | 2 | 10 | 1 1, 1 1.001, 1.001 1.001
101 Scenario: Simple even three point interpolation line
102 Given the place nodes
103 | osm_id | class | type | housenumber | geometry
104 | 1 | place | house | 2 | 1 1
105 | 2 | place | house | 14 | 1.001 1.001
106 | 3 | place | house | 10 | 1 1.001
108 | osm_id | class | type | housenumber | geometry
109 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
114 Then way 1 expands to lines
115 | startnumber | endnumber | geometry
116 | 2 | 10 | 1 1, 1 1.001
117 | 10 | 14 | 1 1.001, 1.001 1.001
119 Scenario: Simple even four point interpolation line
120 Given the place nodes
121 | osm_id | class | type | housenumber | geometry
122 | 1 | place | house | 2 | 1 1
123 | 2 | place | house | 14 | 1.001 1.001
124 | 3 | place | house | 10 | 1 1.001
125 | 4 | place | house | 18 | 1.001 1.002
127 | osm_id | class | type | housenumber | geometry
128 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001, 1.001 1.002
133 Then way 1 expands to lines
134 | startnumber | endnumber | geometry
135 | 2 | 10 | 1 1, 1 1.001
136 | 10 | 14 | 1 1.001, 1.001 1.001
137 | 14 | 18 | 1.001 1.001, 1.001 1.002
139 Scenario: Reverse simple even three point interpolation line
140 Given the place nodes
141 | osm_id | class | type | housenumber | geometry
142 | 1 | place | house | 2 | 1 1
143 | 2 | place | house | 14 | 1.001 1.001
144 | 3 | place | house | 10 | 1 1.001
146 | osm_id | class | type | housenumber | geometry
147 | 1 | place | houses | even | 1.001 1.001, 1 1.001, 1 1
152 Then way 1 expands to lines
153 | startnumber | endnumber | geometry
154 | 2 | 10 | 1 1, 1 1.001
155 | 10 | 14 | 1 1.001, 1.001 1.001
157 Scenario: Even three point interpolation line with odd center point
158 Given the place nodes
159 | osm_id | class | type | housenumber | geometry
160 | 1 | place | house | 2 | 1 1
161 | 2 | place | house | 8 | 1.001 1.001
162 | 3 | place | house | 7 | 1 1.001
164 | osm_id | class | type | housenumber | geometry
165 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
170 Then way 1 expands to lines
171 | startnumber | endnumber | geometry
172 | 2 | 7 | 1 1, 1 1.001
173 | 7 | 8 | 1 1.001, 1.001 1.001
175 Scenario: Interpolation line with self-intersecting way
176 Given the place nodes
177 | osm_id | class | type | housenumber | geometry
178 | 1 | place | house | 2 | 0 0
179 | 2 | place | house | 6 | 0 0.001
180 | 3 | place | house | 10 | 0 0.002
182 | osm_id | class | type | housenumber | geometry
183 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
188 Then way 1 expands to lines
189 | startnumber | endnumber | geometry
190 | 2 | 6 | 0 0, 0 0.001
191 | 6 | 10 | 0 0.001, 0 0.002
192 | 6 | 10 | 0 0.001, 0 0.002
194 Scenario: Interpolation line with self-intersecting way II
195 Given the place nodes
196 | osm_id | class | type | housenumber | geometry
197 | 1 | place | house | 2 | 0 0
198 | 2 | place | house | 6 | 0 0.001
200 | osm_id | class | type | housenumber | geometry
201 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
206 Then way 1 expands to lines
207 | startnumber | endnumber | geometry
208 | 2 | 6 | 0 0, 0 0.001
211 Scenario: addr:street on interpolation way
212 Given the scene parallel-road
214 | osm_id | class | type | housenumber | geometry
215 | 1 | place | house | 2 | :n-middle-w
216 | 2 | place | house | 6 | :n-middle-e
217 | 3 | place | house | 12 | :n-middle-w
218 | 4 | place | house | 16 | :n-middle-e
220 | osm_id | class | type | housenumber | street | geometry
221 | 10 | place | houses | even | | :w-middle
222 | 11 | place | houses | even | Cloud Street | :w-middle
224 | osm_id | class | type | name | geometry
225 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
226 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
229 | 10 | 1,100,101,102,2
230 | 11 | 3,200,201,202,4
232 Then table placex contains
233 | object | parent_place_id
238 Then table location_property_osmline contains
239 | object | parent_place_id | startnumber | endnumber
243 Scenario: addr:street on housenumber way
244 Given the scene parallel-road
246 | osm_id | class | type | housenumber | street | geometry
247 | 1 | place | house | 2 | | :n-middle-w
248 | 2 | place | house | 6 | | :n-middle-e
249 | 3 | place | house | 12 | Cloud Street | :n-middle-w
250 | 4 | place | house | 16 | Cloud Street | :n-middle-e
252 | osm_id | class | type | housenumber | geometry
253 | 10 | place | houses | even | :w-middle
254 | 11 | place | houses | even | :w-middle
256 | osm_id | class | type | name | geometry
257 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
258 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
261 | 10 | 1,100,101,102,2
262 | 11 | 3,200,201,202,4
264 Then table placex contains
265 | object | parent_place_id
270 And table location_property_osmline contains
271 | object | parent_place_id | startnumber | endnumber
275 Scenario: Geometry of points and way don't match (github #253)
276 Given the place nodes
277 | osm_id | class | type | housenumber | geometry
278 | 1 | place | house | 10 | 144.9632341 -37.76163
279 | 2 | place | house | 6 | 144.9630541 -37.7628174
280 | 3 | shop | supermarket | 2 | 144.9629794 -37.7630755
282 | osm_id | class | type | housenumber | geometry
283 | 1 | place | houses | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755
288 Then way 1 expands to lines
289 | startnumber | endnumber | geometry
290 | 2 | 6 | 144.9629794 -37.7630755, 144.9630541 -37.7628174
291 | 6 | 10 | 144.9630541 -37.7628174, 144.9632341 -37.76163
293 Scenario: Place with missing address information
294 Given the place nodes
295 | osm_id | class | type | housenumber | geometry
296 | 1 | place | house | 23 | 0.0001 0.0001
297 | 2 | amenity | school | | 0.0001 0.0002
298 | 3 | place | house | 29 | 0.0001 0.0004
300 | osm_id | class | type | housenumber | geometry
301 | 1 | place | houses | odd | 0.0001 0.0001,0.0001 0.0002,0.0001 0.0004
306 Then way 1 expands to lines
307 | startnumber | endnumber | geometry
308 | 23 | 29 | 0.0001 0.0001, 0.0001 0.0002, 0.0001 0.0004