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: 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"
45 | osm_type | osm_id | name |
46 | N | 1 | 23, Rose Street |
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 |
67 | N2 | place | city | Strange Town | :p-N1 |
69 Then search_name contains
70 | object | name_vector | nameaddress_vector |
71 | N1 | #23 | Walltown |
72 When searching for "23 Rose Street"
73 Then exactly 1 results are returned
75 | osm_type | osm_id | name |
76 | W | 1 | Rose Street, Strange Town |
77 When searching for "23 Walltown"
79 | osm_type | osm_id | name |
80 | N | 1 | 23, Walltown, Strange Town |
82 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
83 Given the scene roads-with-pois
85 | osm | class | type | housenr | addr+place | geometry |
86 | N1 | place | house | 23 | Walltown | :p-N1 |
88 | osm | class | type | name+name | addr+city | geometry |
89 | W1 | highway | residential | Rose Street | Walltown | :w-north |
90 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
92 Then search_name contains
93 | object | name_vector | nameaddress_vector |
94 | N1 | #23 | Walltown |
95 When searching for "23 Rose Street, Walltown"
96 Then exactly 1 result is returned
98 | osm_type | osm_id | name |
99 | W | 1 | Rose Street, Strange Town |
100 When searching for "23 Walltown"
101 Then exactly 1 result is returned
103 | osm_type | osm_id | name |
104 | N | 1 | 23, Walltown, Strange Town |
106 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
107 Given the scene roads-with-pois
109 | osm | class | type | housenr | addr+place | addr+street | geometry |
110 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
112 | osm | class | type | name+name | geometry |
113 | W1 | highway | residential | Rose Street | :w-north |
115 Then search_name has no entry for N1
116 When searching for "23 Rose Street"
118 | osm_type | osm_id | name |
119 | N | 1 | 23, Rose Street |
120 When searching for "23 Lily Street"
121 Then exactly 0 results are returned
123 Scenario: An unknown addr:street is ignored
124 Given the scene roads-with-pois
126 | osm | class | type | housenr | addr+street | geometry |
127 | N1 | place | house | 23 | 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: Named POIs have unknown address tags added in the search_name table
141 Given the scene roads-with-pois
143 | osm | class | type | name+name | addr+city | geometry |
144 | N1 | place | house | Green Moss | Walltown | :p-N1 |
146 | osm | class | type | name+name | geometry |
147 | W1 | highway | residential | Rose Street | :w-north |
149 Then search_name contains
150 | object | name_vector | nameaddress_vector |
151 | N1 | #Green Moss | Rose Street, Walltown |
152 When searching for "Green Moss, Rose Street, Walltown"
154 | osm_type | osm_id | name |
155 | N | 1 | Green Moss, Rose Street |
157 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
158 Given the scene roads-with-pois
160 | osm | class | type | name+name | addr+place | 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 |
165 | N2 | place | suburb | Strange Town | :p-N1 |
167 Then search_name contains
168 | object | name_vector | nameaddress_vector |
169 | N1 | #Green Moss | Walltown |
170 When searching for "Green Moss, Rose Street, Walltown"
171 Then exactly 0 result is returned
172 When searching for "Green Moss, Walltown"
174 | osm_type | osm_id | name |
175 | N | 1 | Green Moss, Walltown, Strange Town |
177 Scenario: Named POIs inherit address from parent
178 Given the scene roads-with-pois
180 | osm | class | type | name | geometry |
181 | N1 | place | house | foo | :p-N1 |
182 | W1 | highway | residential | the road | :w-north |
184 Then search_name contains
185 | object | name_vector | nameaddress_vector |
186 | N1 | foo | the road |
188 Scenario: Some addr: tags are added to address when the name exists
189 Given the scene roads-with-pois
191 | osm | class | type | name | geometry |
192 | N1 | place | state | new york | 80 80 |
193 | N2 | place | city | bonn | 81 81 |
194 | N3 | place | suburb | smalltown| 80 81 |
196 | osm | class | type | addr+city | addr+state | addr+suburb | geometry |
197 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
199 Then search_name contains
200 | object | nameaddress_vector |
201 | W1 | bonn, new york, smalltown |
203 Scenario: A known addr:* tag is added even if the name is unknown
204 Given the scene roads-with-pois
206 | osm | class | type | name | addr+city | geometry |
207 | W1 | highway | residential | Road | Nandu | :w-north |
209 Then search_name contains
210 | object | nameaddress_vector |
213 Scenario: addr:postcode is not added to the address terms
214 Given the scene roads-with-pois
216 | osm | class | type | name+ref | geometry |
217 | N1 | place | state | 12345 | 80 80 |
219 | osm | class | type | addr+postcode | geometry |
220 | W1 | highway | residential | 12345 | :w-north |
222 Then search_name contains not
223 | object | nameaddress_vector |
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