]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/import/search_name.feature
Add optional compilation of osm2pgsl
[nominatim.git] / test / bdd / db / import / search_name.feature
1 @DB
2 Feature: Creation of search terms
3     Tests that search_name table is filled correctly
4
5     Scenario: POIs without a name have no search entry
6         Given the scene roads-with-pois
7         And the places
8          | osm | class   | type        | geometry |
9          | N1  | place   | house       | :p-N1 |
10         And the named places
11          | osm | class   | type        | geometry |
12          | W1  | highway | residential | :w-north |
13         When importing
14         Then search_name has no entry for N1
15
16     Scenario: Named POIs inherit address from parent
17         Given the scene roads-with-pois
18         And the places
19          | osm | class   | type        | name     | geometry |
20          | N1  | place   | house       | foo      | :p-N1 |
21          | W1  | highway | residential | the road | :w-north |
22         When importing
23         Then search_name contains
24          | object | name_vector | nameaddress_vector |
25          | N1     | foo         | the road |
26
27     Scenario: Some addr: tags are added to address when the name exists
28         Given the scene roads-with-pois
29         And the places
30          | osm | class   | type        | name     | geometry |
31          | N1  | place   | state       | new york | 80 80 |
32          | N1  | place   | city        | bonn     | 81 81 |
33          | N1  | place   | suburb      | smalltown| 80 81 |
34         And the named places
35          | osm | class   | type    | addr+city | addr+state | addr+suburb | geometry |
36          | W1  | highway | service | bonn      | New York   | Smalltown   | :w-north |
37         When importing
38         Then search_name contains
39          | object | nameaddress_vector |
40          | W1     | bonn, new york, smalltown |
41
42     Scenario: A known addr:* tag is not added if the name is unknown
43         Given the scene roads-with-pois
44         And the places
45          | osm | class   | type        | name | addr+city | geometry |
46          | W1  | highway | residential | Road | Nandu     | :w-north |
47         When importing
48         Then search_name contains not
49          | object | nameaddress_vector |
50          | W1     | nandu |
51
52     Scenario: addr:postcode is not added to the address terms
53         Given the scene roads-with-pois
54         And the places
55          | osm | class   | type        | name+ref  | geometry |
56          | N1  | place   | state       | 12345     | 80 80 |
57         And the named places
58          | osm | class   | type        | addr+postcode | geometry |
59          | W1  | highway | residential | 12345 | :w-north |
60         When importing
61         Then search_name contains not
62          | object | nameaddress_vector |
63          | W1     | 12345 |
64
65     Scenario: is_in is split and added to the address search terms
66         Given the scene roads-with-pois
67         And the places
68          | osm | class   | type        | name     | geometry |
69          | N1  | place   | state       | new york | 80 80 |
70          | N1  | place   | city        | bonn     | 81 81 |
71          | N1  | place   | suburb      | smalltown| 80 81 |
72         And the named places
73          | osm | class   | type    | addr+is_in                | geometry |
74          | W1  | highway | service | bonn, New York, Smalltown | :w-north |
75         When importing
76         Then search_name contains
77          | object | nameaddress_vector |
78          | W1     | bonn, new york, smalltown |
79