2 Feature: Creation of search terms
3 Tests that search_name table is filled correctly
5 Scenario: Unnamed POIs have no search entry
6 Given the scene roads-with-pois
8 | osm | class | type | geometry |
9 | N1 | place | house | :p-N1 |
11 | osm | class | type | geometry |
12 | W1 | highway | residential | :w-north |
14 Then search_name has no entry for N1
16 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
17 Given the scene roads-with-pois
19 | osm | class | type | housenr | addr+city | geometry |
20 | N1 | place | house | 23 | Walltown | :p-N1 |
22 | osm | class | type | name+name | geometry |
23 | W1 | highway | residential | Rose Street | :w-north |
25 Then search_name contains
26 | object | nameaddress_vector |
27 | N1 | Rose, Street, Walltown |
28 When searching for "23 Rose Street, Walltown"
30 | osm_type | osm_id | name |
31 | N | 1 | 23, Rose Street |
32 When searching for "Walltown, Rose Street 23"
34 | osm_type | osm_id | name |
35 | N | 1 | 23, Rose Street |
36 When searching for "Rose Street 23, Walltown"
38 | osm_type | osm_id | name |
39 | N | 1 | 23, Rose Street |
41 Scenario: Searching for unknown addr: tags also works for multiple words
42 Given the scene roads-with-pois
44 | osm | class | type | housenr | addr+city | geometry |
45 | N1 | place | house | 23 | Little Big Town | :p-N1 |
47 | osm | class | type | name+name | geometry |
48 | W1 | highway | residential | Rose Street | :w-north |
50 Then search_name contains
51 | object | nameaddress_vector |
52 | N1 | Rose Street, Little, Big, Town |
53 When searching for "23 Rose Street, Little Big Town"
55 | osm_type | osm_id | name |
56 | N | 1 | 23, Rose Street |
57 When searching for "Rose Street 23, Little Big Town"
59 | osm_type | osm_id | name |
60 | N | 1 | 23, Rose Street |
61 When searching for "Little big Town, Rose Street 23"
63 | osm_type | osm_id | name |
64 | N | 1 | 23, Rose Street |
66 Scenario: Unnamed POI has no search entry when it has known addr: tags
67 Given the scene roads-with-pois
69 | osm | class | type | housenr | addr+city | geometry |
70 | N1 | place | house | 23 | Walltown | :p-N1 |
72 | osm | class | type | name+name | addr+city | geometry |
73 | W1 | highway | residential | Rose Street | Walltown | :w-north |
75 Then search_name has no entry for N1
76 When searching for "23 Rose Street, Walltown"
78 | osm_type | osm_id | name |
79 | N | 1 | 23, Rose Street |
81 Scenario: Unnamed POI must have a house number to get a search entry
82 Given the scene roads-with-pois
84 | osm | class | type | addr+city | geometry |
85 | N1 | place | house | Walltown | :p-N1 |
87 | osm | class | type | name+name | geometry |
88 | W1 | highway | residential | Rose Street | :w-north |
90 Then search_name has no entry for N1
92 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
93 Given the scene roads-with-pois
95 | osm | class | type | housenr | addr+place | geometry |
96 | N1 | place | house | 23 | Walltown | :p-N1 |
98 | osm | class | type | name+name | geometry |
99 | W1 | highway | residential | Rose Street | :w-north |
100 | N2 | place | city | Strange Town | :p-N1 |
103 | object | parent_place_id |
105 Then search_name contains
106 | object | name_vector | nameaddress_vector |
107 | N1 | #Walltown | Strange, Town |
108 When searching for "23 Rose Street"
109 Then exactly 1 results are returned
111 | osm_type | osm_id | name |
112 | W | 1 | Rose Street, Strange Town |
113 When searching for "23 Walltown, Strange Town"
115 | osm_type | osm_id | name |
116 | N | 1 | 23, Walltown, Strange Town |
117 When searching for "Walltown 23, Strange Town"
119 | osm_type | osm_id | name |
120 | N | 1 | 23, Walltown, Strange Town |
121 When searching for "Strange Town, Walltown 23"
123 | osm_type | osm_id | name |
124 | N | 1 | 23, Walltown, Strange Town |
126 Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
127 Given the scene roads-with-pois
129 | osm | class | type | name | housenr | addr+place | geometry |
130 | N1 | place | house | Blue house | 23 | Walltown | :p-N1 |
132 | osm | class | type | name+name | geometry |
133 | W1 | highway | residential | Rose Street | :w-north |
134 | N2 | place | city | Strange Town | :p-N1 |
136 Then search_name contains
137 | object | name_vector | nameaddress_vector |
138 | N1 | #Walltown, #Blue house | Walltown, Strange, Town |
139 When searching for "23 Walltown, Strange Town"
141 | osm_type | osm_id | name |
142 | N | 1 | Blue house, 23, Walltown, Strange Town |
143 When searching for "Walltown 23, Strange Town"
145 | osm_type | osm_id | name |
146 | N | 1 | Blue house, 23, Walltown, Strange Town |
147 When searching for "Strange Town, Walltown 23"
149 | osm_type | osm_id | name |
150 | N | 1 | Blue house, 23, Walltown, Strange Town |
151 When searching for "Strange Town, Walltown 23, Blue house"
153 | osm_type | osm_id | name |
154 | N | 1 | Blue house, 23, Walltown, Strange Town |
155 When searching for "Strange Town, Walltown, Blue house"
157 | osm_type | osm_id | name |
158 | N | 1 | Blue house, 23, Walltown, Strange Town |
160 Scenario: Named POIs can be found when unknown multi-word addr:place is present
161 Given the scene roads-with-pois
163 | osm | class | type | name | housenr | addr+place | geometry |
164 | N1 | place | house | Blue house | 23 | Moon sun | :p-N1 |
166 | osm | class | type | name+name | geometry |
167 | W1 | highway | residential | Rose Street | :w-north |
168 | N2 | place | city | Strange Town | :p-N1 |
170 Then search_name contains
171 | object | name_vector | nameaddress_vector |
172 | N1 | #Moon sun, #Blue house | Moon, Sun, Strange, Town |
173 When searching for "23 Moon Sun, Strange Town"
175 | osm_type | osm_id | name |
176 | N | 1 | Blue house, 23, Moon sun, Strange Town |
177 When searching for "Blue house, Moon Sun, Strange Town"
179 | osm_type | osm_id | name |
180 | N | 1 | Blue house, 23, Moon sun, Strange Town |
182 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
183 Given the scene roads-with-pois
185 | osm | class | type | housenr | addr+place | geometry |
186 | N1 | place | house | 23 | Walltown | :p-N1 |
188 | osm | class | type | name+name | addr+city | geometry |
189 | W1 | highway | residential | Rose Street | Walltown | :w-north |
190 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
192 Then search_name contains
193 | object | name_vector | nameaddress_vector |
194 | N1 | #Walltown | Strange, Town |
195 When searching for "23 Rose Street, Walltown"
196 Then exactly 1 result is returned
198 | osm_type | osm_id | name |
199 | W | 1 | Rose Street, Strange Town |
200 When searching for "23 Walltown"
201 Then exactly 1 result is returned
203 | osm_type | osm_id | name |
204 | N | 1 | 23, Walltown, Strange Town |
206 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
207 Given the scene roads-with-pois
209 | osm | class | type | housenr | addr+place | addr+street | geometry |
210 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
212 | osm | class | type | name+name | geometry |
213 | W1 | highway | residential | Rose Street | :w-north |
215 Then search_name has no entry for N1
216 When searching for "23 Rose Street"
218 | osm_type | osm_id | name |
219 | N | 1 | 23, Rose Street |
220 When searching for "23 Lily Street"
221 Then exactly 0 results are returned
223 Scenario: An unknown addr:street is ignored
224 Given the scene roads-with-pois
226 | osm | class | type | housenr | addr+street | geometry |
227 | N1 | place | house | 23 | Lily Street | :p-N1 |
229 | osm | class | type | name+name | geometry |
230 | W1 | highway | residential | Rose Street | :w-north |
232 Then search_name has no entry for N1
233 When searching for "23 Rose Street"
235 | osm_type | osm_id | name |
236 | N | 1 | 23, Rose Street |
237 When searching for "23 Lily Street"
238 Then exactly 0 results are returned
240 Scenario: Named POIs get unknown address tags added in the search_name table
241 Given the scene roads-with-pois
243 | osm | class | type | name+name | housenr | addr+city | geometry |
244 | N1 | place | house | Green Moss | 26 | Walltown | :p-N1 |
246 | osm | class | type | name+name | geometry |
247 | W1 | highway | residential | Rose Street | :w-north |
249 Then search_name contains
250 | object | name_vector | nameaddress_vector |
251 | N1 | #Green Moss | Rose, Street, Walltown |
252 When searching for "Green Moss, Rose Street, Walltown"
254 | osm_type | osm_id | name |
255 | N | 1 | Green Moss, 26, Rose Street |
256 When searching for "Green Moss, 26, Rose Street, Walltown"
258 | osm_type | osm_id | name |
259 | N | 1 | Green Moss, 26, Rose Street |
260 When searching for "26, Rose Street, Walltown"
262 | osm_type | osm_id | name |
263 | N | 1 | Green Moss, 26, Rose Street |
264 When searching for "Rose Street 26, Walltown"
266 | osm_type | osm_id | name |
267 | N | 1 | Green Moss, 26, Rose Street |
268 When searching for "Walltown, Rose Street 26"
270 | osm_type | osm_id | name |
271 | N | 1 | Green Moss, 26, Rose Street |
273 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
274 Given the scene roads-with-pois
276 | osm | class | type | name+name | addr+place | geometry |
277 | N1 | place | house | Green Moss | Walltown | :p-N1 |
279 | osm | class | type | name+name | geometry |
280 | W1 | highway | residential | Rose Street | :w-north |
281 | N2 | place | suburb | Strange Town | :p-N1 |
283 Then search_name contains
284 | object | name_vector | nameaddress_vector |
285 | N1 | #Green Moss | Walltown |
286 When searching for "Green Moss, Rose Street, Walltown"
287 Then exactly 0 result is returned
288 When searching for "Green Moss, Walltown"
290 | osm_type | osm_id | name |
291 | N | 1 | Green Moss, Walltown, Strange Town |
293 Scenario: Named POIs inherit address from parent
294 Given the scene roads-with-pois
296 | osm | class | type | name | geometry |
297 | N1 | place | house | foo | :p-N1 |
298 | W1 | highway | residential | the road | :w-north |
300 Then search_name contains
301 | object | name_vector | nameaddress_vector |
302 | N1 | foo | the road |
304 Scenario: Some addr: tags are added to address
305 Given the scene roads-with-pois
307 | osm | class | type | name | geometry |
308 | N2 | place | city | bonn | 81 81 |
309 | N3 | place | suburb | smalltown| 80 81 |
311 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
312 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
314 Then search_name contains
315 | object | nameaddress_vector |
316 | W1 | bonn, new, york, smalltown |
318 Scenario: A known addr:* tag is added even if the name is unknown
319 Given the scene roads-with-pois
321 | osm | class | type | name | addr+city | geometry |
322 | W1 | highway | residential | Road | Nandu | :w-north |
324 Then search_name contains
325 | object | nameaddress_vector |
328 Scenario: addr:postcode is not added to the address terms
329 Given the scene roads-with-pois
331 | osm | class | type | name+ref | geometry |
332 | N1 | place | state | 12345 | 80 80 |
334 | osm | class | type | addr+postcode | geometry |
335 | W1 | highway | residential | 12345 | :w-north |
337 Then search_name contains not
338 | object | nameaddress_vector |
341 Scenario: a linked place does not show up in search name
342 Given the named places
343 | osm | class | type | admin | geometry |
344 | R13 | boundary | administrative | 9 | poly-area:0.01 |
346 | osm | class | type | geometry |
347 | N2 | place | city | 0.1 0.1 |
349 | id | members | tags+type |
350 | 13 | N2:label | boundary |
353 | object | linked_place_id |
355 And search_name has no entry for N2
357 Scenario: a linked waterway does not show up in search name
358 Given the scene split-road
360 | osm | class | type | name | geometry |
361 | W1 | waterway | river | Rhein | :w-2 |
362 | W2 | waterway | river | Rhein | :w-3 |
363 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
365 | id | members | tags+type |
366 | 13 | W1,W2:main_stream | waterway |
369 | object | linked_place_id |
372 And search_name has no entry for W1
373 And search_name has no entry for W2