]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/query/postcodes.feature
release 5.1.0.post6
[nominatim.git] / test / bdd / features / db / query / postcodes.feature
1 Feature: Querying fo postcode variants
2
3     Scenario: Postcodes in Singapore (6-digit postcode)
4         Given the grid with origin SG
5             | 10 |   |   |   | 11 |
6         And the places
7             | osm | class   | type | name   | addr+postcode | geometry |
8             | W1  | highway | path | Lorang | 399174        | 10,11    |
9         When importing
10         When geocoding "399174"
11         Then result 0 contains
12             | type     | display_name |
13             | postcode | 399174, Singapore |
14
15
16     Scenario Outline: Postcodes in the Netherlands (mixed postcode with spaces)
17         Given the grid with origin NL
18             | 10 |   |   |   | 11 |
19         And the places
20             | osm | class   | type | name     | addr+postcode | geometry |
21             | W1  | highway | path | De Weide | 3993 DX       | 10,11    |
22         When importing
23         When geocoding "3993 DX"
24         Then result 0 contains
25             | type     | display_name |
26             | postcode | 3993 DX, Nederland      |
27         When geocoding "3993dx"
28         Then result 0 contains
29             | type     | display_name |
30             | postcode | 3993 DX, Nederland      |
31
32         Examples:
33             | postcode |
34             | 3993 DX  |
35             | 3993DX   |
36             | 3993 dx  |
37
38
39     Scenario: Postcodes in Singapore (6-digit postcode)
40         Given the grid with origin SG
41             | 10 |   |   |   | 11 |
42         And the places
43             | osm | class   | type | name   | addr+postcode | geometry |
44             | W1  | highway | path | Lorang | 399174        | 10,11    |
45         When importing
46         When geocoding "399174"
47         Then result 0 contains
48             | type     | display_name |
49             | postcode | 399174, Singapore       |
50
51
52     Scenario Outline: Postcodes in Andorra (with country code)
53         Given the grid with origin AD
54             | 10 |   |   |   | 11 |
55         And the places
56             | osm | class   | type | name   | addr+postcode | geometry |
57             | W1  | highway | path | Lorang | <postcode>    | 10,11    |
58         When importing
59         When geocoding "675"
60         Then result 0 contains
61             | type     | display_name |
62             | postcode | AD675, Andorra |
63         When geocoding "AD675"
64         Then result 0 contains
65             | type     | display_name |
66             | postcode | AD675, Andorra |
67
68         Examples:
69             | postcode |
70             | 675      |
71             | AD 675   |
72             | AD675    |
73
74
75     Scenario: Different postcodes with the same normalization can both be found
76         Given the places
77            | osm | class | type  | addr+postcode | addr+housenumber | geometry |
78            | N34 | place | house | EH4 7EA       | 111              | country:gb |
79            | N35 | place | house | E4 7EA        | 111              | country:gb |
80         When importing
81         Then location_postcode contains exactly
82            | country_code | postcode | geometry!wkt |
83            | gb           | EH4 7EA  | country:gb |
84            | gb           | E4 7EA   | country:gb |
85         When geocoding "EH4 7EA"
86         Then result 0 contains
87            | type     | display_name |
88            | postcode | EH4 7EA, United Kingdom |
89         When geocoding "E4 7EA"
90         Then result 0 contains
91            | type     | display_name |
92            | postcode | E4 7EA, United Kingdom |
93
94
95     Scenario: Postcode areas are preferred over postcode points
96         Given the grid with origin DE
97             | 1 | 2 |
98             | 4 | 3 |
99         Given the places
100             | osm | class    | type        | postcode | geometry    |
101             | R23 | boundary | postal_code | 12345    | (1,2,3,4,1) |
102         When importing
103         Then location_postcode contains exactly
104           | country_code | postcode |
105           | de           | 12345    |
106         When geocoding "12345, de"
107         Then result 0 contains
108           | object |
109           | R23 |