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 | name_vector | nameaddress_vector |
27 | N1 | #23 | Rose Street, Walltown |
28 When searching for "23 Rose Street, Walltown"
30 | osm_type | osm_id | name |
31 | N | 1 | 23, Rose Street |
33 Scenario: Searching for unknown addr: tags also works for multiple words
34 Given the scene roads-with-pois
36 | osm | class | type | housenr | addr+city | geometry |
37 | N1 | place | house | 23 | Little Big Town | :p-N1 |
39 | osm | class | type | name+name | geometry |
40 | W1 | highway | residential | Rose Street | :w-north |
42 Then search_name contains
43 | object | name_vector | nameaddress_vector |
44 | N1 | #23 | Rose Street, Little, Big, Town |
45 When searching for "23 Rose Street, Little Big Town"
47 | osm_type | osm_id | name |
48 | N | 1 | 23, Rose Street |
50 Scenario: Unnamed POI has no search entry when it has known addr: tags
51 Given the scene roads-with-pois
53 | osm | class | type | housenr | addr+city | geometry |
54 | N1 | place | house | 23 | Walltown | :p-N1 |
56 | osm | class | type | name+name | addr+city | geometry |
57 | W1 | highway | residential | Rose Street | Walltown | :w-north |
59 Then search_name has no entry for N1
60 When searching for "23 Rose Street, Walltown"
62 | osm_type | osm_id | name |
63 | N | 1 | 23, Rose Street |
65 Scenario: Unnamed POI must have a house number to get a search entry
66 Given the scene roads-with-pois
68 | osm | class | type | addr+city | geometry |
69 | N1 | place | house | Walltown | :p-N1 |
71 | osm | class | type | name+name | geometry |
72 | W1 | highway | residential | Rose Street | :w-north |
74 Then search_name has no entry for N1
76 Scenario: Unnamed POIs doesn't inherit parent name when unknown addr:place is present
77 Given the scene roads-with-pois
79 | osm | class | type | housenr | addr+place | geometry |
80 | N1 | place | house | 23 | Walltown | :p-N1 |
82 | osm | class | type | name+name | geometry |
83 | W1 | highway | residential | Rose Street | :w-north |
84 | N2 | place | city | Strange Town | :p-N1 |
86 Then search_name contains
87 | object | name_vector | nameaddress_vector |
88 | N1 | #23 | Walltown |
89 When searching for "23 Rose Street"
90 Then exactly 1 results are returned
92 | osm_type | osm_id | name |
93 | W | 1 | Rose Street, Strange Town |
94 When searching for "23 Walltown"
96 | osm_type | osm_id | name |
97 | N | 1 | 23, Walltown, Strange Town |
99 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
100 Given the scene roads-with-pois
102 | osm | class | type | housenr | addr+place | geometry |
103 | N1 | place | house | 23 | Walltown | :p-N1 |
105 | osm | class | type | name+name | addr+city | geometry |
106 | W1 | highway | residential | Rose Street | Walltown | :w-north |
107 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
109 Then search_name contains
110 | object | name_vector | nameaddress_vector |
111 | N1 | #23 | Walltown |
112 When searching for "23 Rose Street, Walltown"
113 Then exactly 1 result is returned
115 | osm_type | osm_id | name |
116 | W | 1 | Rose Street, Strange Town |
117 When searching for "23 Walltown"
118 Then exactly 1 result is returned
120 | osm_type | osm_id | name |
121 | N | 1 | 23, Walltown, Strange Town |
123 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
124 Given the scene roads-with-pois
126 | osm | class | type | housenr | addr+place | addr+street | geometry |
127 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
129 | osm | class | type | name+name | geometry |
130 | W1 | highway | residential | Rose Street | :w-north |
132 Then search_name has no entry for N1
133 When searching for "23 Rose Street"
135 | osm_type | osm_id | name |
136 | N | 1 | 23, Rose Street |
137 When searching for "23 Lily Street"
138 Then exactly 0 results are returned
140 Scenario: An unknown addr:street is ignored
141 Given the scene roads-with-pois
143 | osm | class | type | housenr | addr+street | geometry |
144 | N1 | place | house | 23 | Lily Street | :p-N1 |
146 | osm | class | type | name+name | geometry |
147 | W1 | highway | residential | Rose Street | :w-north |
149 Then search_name has no entry for N1
150 When searching for "23 Rose Street"
152 | osm_type | osm_id | name |
153 | N | 1 | 23, Rose Street |
154 When searching for "23 Lily Street"
155 Then exactly 0 results are returned
157 Scenario: Named POIs have unknown address tags added in the search_name table
158 Given the scene roads-with-pois
160 | osm | class | type | name+name | addr+city | geometry |
161 | N1 | place | house | Green Moss | Walltown | :p-N1 |
163 | osm | class | type | name+name | geometry |
164 | W1 | highway | residential | Rose Street | :w-north |
166 Then search_name contains
167 | object | name_vector | nameaddress_vector |
168 | N1 | #Green Moss | Rose Street, Walltown |
169 When searching for "Green Moss, Rose Street, Walltown"
171 | osm_type | osm_id | name |
172 | N | 1 | Green Moss, Rose Street |
174 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
175 Given the scene roads-with-pois
177 | osm | class | type | name+name | addr+place | geometry |
178 | N1 | place | house | Green Moss | Walltown | :p-N1 |
180 | osm | class | type | name+name | geometry |
181 | W1 | highway | residential | Rose Street | :w-north |
182 | N2 | place | suburb | Strange Town | :p-N1 |
184 Then search_name contains
185 | object | name_vector | nameaddress_vector |
186 | N1 | #Green Moss | Walltown |
187 When searching for "Green Moss, Rose Street, Walltown"
188 Then exactly 0 result is returned
189 When searching for "Green Moss, Walltown"
191 | osm_type | osm_id | name |
192 | N | 1 | Green Moss, Walltown, Strange Town |
194 Scenario: Named POIs inherit address from parent
195 Given the scene roads-with-pois
197 | osm | class | type | name | geometry |
198 | N1 | place | house | foo | :p-N1 |
199 | W1 | highway | residential | the road | :w-north |
201 Then search_name contains
202 | object | name_vector | nameaddress_vector |
203 | N1 | foo | the road |
205 Scenario: Some addr: tags are added to address
206 Given the scene roads-with-pois
208 | osm | class | type | name | geometry |
209 | N2 | place | city | bonn | 81 81 |
210 | N3 | place | suburb | smalltown| 80 81 |
212 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
213 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
215 Then search_name contains
216 | object | nameaddress_vector |
217 | W1 | bonn, new, york, smalltown |
219 Scenario: A known addr:* tag is added even if the name is unknown
220 Given the scene roads-with-pois
222 | osm | class | type | name | addr+city | geometry |
223 | W1 | highway | residential | Road | Nandu | :w-north |
225 Then search_name contains
226 | object | nameaddress_vector |
229 Scenario: addr:postcode is not added to the address terms
230 Given the scene roads-with-pois
232 | osm | class | type | name+ref | geometry |
233 | N1 | place | state | 12345 | 80 80 |
235 | osm | class | type | addr+postcode | geometry |
236 | W1 | highway | residential | 12345 | :w-north |
238 Then search_name contains not
239 | object | nameaddress_vector |
242 Scenario: a linked place does not show up in search name
243 Given the named places
244 | osm | class | type | admin | geometry |
245 | R13 | boundary | administrative | 9 | poly-area:0.01 |
247 | osm | class | type | geometry |
248 | N2 | place | city | 0.1 0.1 |
250 | id | members | tags+type |
251 | 13 | N2:label | boundary |
254 | object | linked_place_id |
256 And search_name has no entry for N2
258 Scenario: a linked waterway does not show up in search name
259 Given the scene split-road
261 | osm | class | type | name | geometry |
262 | W1 | waterway | river | Rhein | :w-2 |
263 | W2 | waterway | river | Rhein | :w-3 |
264 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
266 | id | members | tags+type |
267 | 13 | W1,W2:main_stream | waterway |
270 | object | linked_place_id |
273 And search_name has no entry for W1
274 And search_name has no entry for W2