]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/import/search_name.feature
Merge branch 'separate-compilation' of https://github.com/eyusupov/Nominatim into...
[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          | N2  | place   | city        | bonn     | 81 81 |
33          | N3  | 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          | N2  | place   | city        | bonn     | 81 81 |
71          | N3  | 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
80     Scenario: a linked place does not show up in search name
81         Given the named places
82          | osm  | class    | type           | admin | geometry |
83          | R13  | boundary | administrative | 9     | poly-area:0.01 |
84         And the named places
85          | osm  | class    | type           | geometry |
86          | N2   | place    | city           | 0.1 0.1 |
87         And the relations
88          | id | members       | tags+type |
89          | 13 | N2:label      | boundary |
90         When importing
91         Then placex contains
92          | object | linked_place_id |
93          | N2     | R13             |
94         And search_name has no entry for N2
95
96     Scenario: a linked waterway does not show up in search name
97         Given the scene split-road
98         And the places
99          | osm | class    | type  | name  | geometry |
100          | W1  | waterway | river | Rhein | :w-2 |
101          | W2  | waterway | river | Rhein | :w-3 |
102          | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
103         And the relations
104          | id | members            | tags+type |
105          | 13 | W1,W2:main_stream  | waterway |
106         When importing
107         Then placex contains
108          | object | linked_place_id |
109          | W1     | R13 |
110          | W2     | R13 |
111         And search_name has no entry for W1
112         And search_name has no entry for W2