1 Feature: Querying fo postcode variants
 
   3     Scenario: Postcodes in Singapore (6-digit postcode)
 
   4         Given the grid with origin SG
 
   7             | osm | class   | type | name   | addr+postcode | geometry |
 
   8             | W1  | highway | path | Lorang | 399174        | 10,11    |
 
  10         When geocoding "399174"
 
  11         Then result 0 contains
 
  12             | type     | display_name |
 
  13             | postcode | 399174, Singapore |
 
  16     Scenario Outline: Postcodes in the Netherlands (mixed postcode with spaces)
 
  17         Given the grid with origin NL
 
  20             | osm | class   | type | name     | addr+postcode | geometry |
 
  21             | W1  | highway | path | De Weide | 3993 DX       | 10,11    |
 
  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      |
 
  39     Scenario: Postcodes in Singapore (6-digit postcode)
 
  40         Given the grid with origin SG
 
  43             | osm | class   | type | name   | addr+postcode | geometry |
 
  44             | W1  | highway | path | Lorang | 399174        | 10,11    |
 
  46         When geocoding "399174"
 
  47         Then result 0 contains
 
  48             | type     | display_name |
 
  49             | postcode | 399174, Singapore       |
 
  52     Scenario Outline: Postcodes in Andorra (with country code)
 
  53         Given the grid with origin AD
 
  56             | osm | class   | type | name   | addr+postcode | geometry |
 
  57             | W1  | highway | path | Lorang | <postcode>    | 10,11    |
 
  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 |
 
  75     Scenario: Different postcodes with the same normalization can both be found
 
  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 |
 
  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 |
 
  95     Scenario: Postcode areas are preferred over postcode points
 
  96         Given the grid with origin DE
 
 100             | osm | class    | type        | postcode | geometry    |
 
 101             | R23 | boundary | postal_code | 12345    | (1,2,3,4,1) |
 
 103         Then location_postcode contains exactly
 
 104           | country_code | postcode |
 
 106         When geocoding "12345, de"
 
 107         Then result 0 contains