]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/query/postcodes.feature
adapt search algorithm to new postcode format in word
[nominatim.git] / test / bdd / db / query / postcodes.feature
1 @DB
2 @fail-legacy
3 Feature: Querying fo postcode variants
4
5     Scenario: Postcodes in Singapore (6-digit postcode)
6         Given the grid with origin SG
7             | 10 |   |   |   | 11 |
8         And the places
9             | osm | class   | type | name   | addr+postcode | geometry |
10             | W1  | highway | path | Lorang | 399174        | 10,11    |
11         When importing
12         When sending search query "399174"
13         Then results contain
14             | ID | type     | display_name |
15             | 0  | postcode | 399174       |
16
17
18     Scenario Outline: Postcodes in the Netherlands (mixed postcode with spaces)
19         Given the grid with origin NL
20             | 10 |   |   |   | 11 |
21         And the places
22             | osm | class   | type | name     | addr+postcode | geometry |
23             | W1  | highway | path | De Weide | 3993 DX       | 10,11    |
24         When importing
25         When sending search query "3993 DX"
26         Then results contain
27             | ID | type     | display_name |
28             | 0  | postcode | 3993 DX      |
29         When sending search query "3993dx"
30         Then results contain
31             | ID | type     | display_name |
32             | 0  | postcode | 3993 DX      |
33
34         Examples:
35             | postcode |
36             | 3993 DX  |
37             | 3993DX   |
38             | 3993 dx  |
39
40
41     Scenario: Postcodes in Singapore (6-digit postcode)
42         Given the grid with origin SG
43             | 10 |   |   |   | 11 |
44         And the places
45             | osm | class   | type | name   | addr+postcode | geometry |
46             | W1  | highway | path | Lorang | 399174        | 10,11    |
47         When importing
48         When sending search query "399174"
49         Then results contain
50             | ID | type     | display_name |
51             | 0  | postcode | 399174       |
52
53
54     Scenario Outline: Postcodes in Andorra (with country code)
55         Given the grid with origin AD
56             | 10 |   |   |   | 11 |
57         And the places
58             | osm | class   | type | name   | addr+postcode | geometry |
59             | W1  | highway | path | Lorang | <postcode>    | 10,11    |
60         When importing
61         When sending search query "675"
62         Then results contain
63             | ID | type     | display_name |
64             | 0  | postcode | AD675        |
65         When sending search query "AD675"
66         Then results contain
67             | ID | type     | display_name |
68             | 0  | postcode | AD675        |
69
70         Examples:
71             | postcode |
72             | 675      |
73             | AD 675   |
74             | AD675    |
75
76
77     Scenario: Different postcodes with the same normalization can both be found
78         Given the places
79            | osm | class | type  | addr+postcode | addr+housenumber | geometry |
80            | N34 | place | house | EH4 7EA       | 111              | country:gb |
81            | N35 | place | house | E4 7EA        | 111              | country:gb |
82         When importing
83         Then location_postcode contains exactly
84            | country | postcode | geometry |
85            | gb      | EH4 7EA  | country:gb |
86            | gb      | E4 7EA   | country:gb |
87         When sending search query "EH4 7EA"
88         Then results contain
89            | type     | display_name |
90            | postcode | EH4 7EA      |
91         When sending search query "E4 7EA"
92         Then results contain
93            | type     | display_name |
94            | postcode | E4 7EA       |
95