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"
33 Scenario: Unnamed POI has no search entry when it has known addr: tags
34 Given the scene roads-with-pois
36 | osm | class | type | housenr | addr+city | geometry |
37 | N1 | place | house | 23 | Walltown | :p-N1 |
39 | osm | class | type | name+name | addr+city | geometry |
40 | W1 | highway | residential | Rose Street | Walltown | :w-north |
42 Then search_name has no entry for N1
43 When searching for "23 Rose Street, Walltown"
48 Scenario: Unnamed POI must have a house number to get a search entry
49 Given the scene roads-with-pois
51 | osm | class | type | addr+city | geometry |
52 | N1 | place | house | Walltown | :p-N1 |
54 | osm | class | type | name+name | geometry |
55 | W1 | highway | residential | Rose Street | :w-north |
57 Then search_name has no entry for N1
59 Scenario: Unnamed POIs doesn't inherit parent name when unknown addr:place is present
60 Given the scene roads-with-pois
62 | osm | class | type | housenr | addr+place | geometry |
63 | N1 | place | house | 23 | Walltown | :p-N1 |
65 | osm | class | type | name+name | geometry |
66 | W1 | highway | residential | Rose Street | :w-north |
68 Then search_name contains
69 | object | name_vector | nameaddress_vector |
70 | N1 | #23 | Walltown |
71 When searching for "23 Rose Street, Walltown"
72 Then exactly 0 results are returned
74 # XXX Need to change parenting of POis without addr:street and with addr:place
75 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
76 Given the scene roads-with-pois
78 | osm | class | type | housenr | addr+place | geometry |
79 | N1 | place | house | 23 | Walltown | :p-N1 |
81 | osm | class | type | name+name | addr+city | geometry |
82 | W1 | highway | residential | Rose Street | Walltown | :w-north |
84 Then search_name contains
85 | object | name_vector | nameaddress_vector |
86 | N1 | #23 | Walltown |
87 When searching for "23 Rose Street, Walltown"
88 Then exactly 1 result is returned
93 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
94 Given the scene roads-with-pois
96 | osm | class | type | housenr | addr+place | addr+street | geometry |
97 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
99 | osm | class | type | name+name | geometry |
100 | W1 | highway | residential | Rose Street | :w-north |
102 Then search_name has no entry for N1
103 When searching for "23 Rose Street"
105 | osm_type | osm_id |
107 When searching for "23 Lily Street"
108 Then exactly 0 results are returned
110 Scenario: An unknown addr:street is ignored
111 Given the scene roads-with-pois
113 | osm | class | type | housenr | addr+street | geometry |
114 | N1 | place | house | 23 | Lily Street | :p-N1 |
116 | osm | class | type | name+name | geometry |
117 | W1 | highway | residential | Rose Street | :w-north |
119 Then search_name has no entry for N1
120 When searching for "23 Rose Street"
122 | osm_type | osm_id |
124 When searching for "23 Lily Street"
125 Then exactly 0 results are returned
127 Scenario: Named POIs have unknown address tags added in the search_name table
128 Given the scene roads-with-pois
130 | osm | class | type | name+name | addr+city | geometry |
131 | N1 | place | house | Green Moss | Walltown | :p-N1 |
133 | osm | class | type | name+name | geometry |
134 | W1 | highway | residential | Rose Street | :w-north |
136 Then search_name contains
137 | object | name_vector | nameaddress_vector |
138 | N1 | #Green Moss | Rose Street, Walltown |
139 When searching for "Green Moss, Rose Street, Walltown"
141 | osm_type | osm_id |
144 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
145 Given the scene roads-with-pois
147 | osm | class | type | name+name | addr+place | geometry |
148 | N1 | place | house | Green Moss | Walltown | :p-N1 |
150 | osm | class | type | name+name | geometry |
151 | W1 | highway | residential | Rose Street | :w-north |
153 Then search_name contains
154 | object | name_vector | nameaddress_vector |
155 | N1 | #Green Moss | Walltown |
156 When searching for "Green Moss, Rose Street, Walltown"
157 Then exactly 1 result is returned
159 | osm_type | osm_id |
162 Scenario: Named POIs inherit address from parent
163 Given the scene roads-with-pois
165 | osm | class | type | name | geometry |
166 | N1 | place | house | foo | :p-N1 |
167 | W1 | highway | residential | the road | :w-north |
169 Then search_name contains
170 | object | name_vector | nameaddress_vector |
171 | N1 | foo | the road |
173 Scenario: Some addr: tags are added to address when the name exists
174 Given the scene roads-with-pois
176 | osm | class | type | name | geometry |
177 | N1 | place | state | new york | 80 80 |
178 | N2 | place | city | bonn | 81 81 |
179 | N3 | place | suburb | smalltown| 80 81 |
181 | osm | class | type | addr+city | addr+state | addr+suburb | geometry |
182 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
184 Then search_name contains
185 | object | nameaddress_vector |
186 | W1 | bonn, new york, smalltown |
188 Scenario: A known addr:* tag is added even if the name is unknown
189 Given the scene roads-with-pois
191 | osm | class | type | name | addr+city | geometry |
192 | W1 | highway | residential | Road | Nandu | :w-north |
194 Then search_name contains
195 | object | nameaddress_vector |
198 Scenario: addr:postcode is not added to the address terms
199 Given the scene roads-with-pois
201 | osm | class | type | name+ref | geometry |
202 | N1 | place | state | 12345 | 80 80 |
204 | osm | class | type | addr+postcode | geometry |
205 | W1 | highway | residential | 12345 | :w-north |
207 Then search_name contains not
208 | object | nameaddress_vector |
211 Scenario: is_in is split and added to the address search terms
212 Given the scene roads-with-pois
214 | osm | class | type | name | geometry |
215 | N1 | place | state | new york | 80 80 |
216 | N2 | place | city | bonn | 81 81 |
217 | N3 | place | suburb | smalltown| 80 81 |
219 | osm | class | type | addr+is_in | geometry |
220 | W1 | highway | service | bonn, New York, Smalltown | :w-north |
222 Then search_name contains
223 | object | nameaddress_vector |
224 | W1 | bonn, new york, smalltown |
226 Scenario: a linked place does not show up in search name
227 Given the named places
228 | osm | class | type | admin | geometry |
229 | R13 | boundary | administrative | 9 | poly-area:0.01 |
231 | osm | class | type | geometry |
232 | N2 | place | city | 0.1 0.1 |
234 | id | members | tags+type |
235 | 13 | N2:label | boundary |
238 | object | linked_place_id |
240 And search_name has no entry for N2
242 Scenario: a linked waterway does not show up in search name
243 Given the scene split-road
245 | osm | class | type | name | geometry |
246 | W1 | waterway | river | Rhein | :w-2 |
247 | W2 | waterway | river | Rhein | :w-3 |
248 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
250 | id | members | tags+type |
251 | 13 | W1,W2:main_stream | waterway |
254 | object | linked_place_id |
257 And search_name has no entry for W1
258 And search_name has no entry for W2