@PeterLudemann @david_chisnall @ashwin @Dav I started doing this in address forms that make the State/Province/Region field required:
@jernej__s @PeterLudemann @ashwin @Dav
Address boxes annoy me so much. In the UK, every postal address can be identified by two pieces of information:
The building name / number.
The postcode.
In any situation where this is not the case, the Royal Mail subdivides the postcode to make it true.
If you're building a system that accepts international addresses, you need to support a load of different things, but there are a bunch of forms I've filled in where they only accept UK addresses but make something like city or county mandatory.
@david_chisnall @PeterLudemann @ashwin @Dav I wouldn't be surprised if courier services need the city name – I've had problems in the past when I entered my exact post code instead of 1000 (which covers the whole city) when the item was being delivered by something other than Post.
@jernej__s @PeterLudemann @ashwin @Dav
The Royal Mail's postcode database is available to buy (it's also free to query for limited purposes). A delivery service has no business operating if they don't buy a subscription to have access to the latest version.
If all that you need is the city, the first three or four digits will give you that. New postcodes share a common prefix with nearby ones, so it's quite easy to determine the city / town / village with a year-old copy of the database.
The bigger problem is companies using things like Google Maps for delivery, where they take a year or two to add new streets to their maps. The postcode will give them a rough area (the official database contains a set of OS Map coordinates for polygon that the postcode covers), but that doesn't help if their navigation system thinks there are no roads there.
When we moved in, the postcode was in the database before the house was completed. The road was on OpenStreetMap as under construction within a few weeks of planning permission being granted and had the under-construction markers removed once it was completed. It took Google and a few other commercial map vendors over a year to add it to their map. I got a lot of calls from delivery drivers saying 'I am nearby but your house doesn't exist' or some variation. And a shocking number of them were really, really bad at following directions.
@david_chisnall @jernej__s @ashwin @Dav
40 years ago, I wrote some programs that used the Canadian postal code database -- at the time, it was more-or-less free (I think we had to provide a magnetic tape) and easy to use. (Like the UK postal codes, the beginning letter-digit-letter gives a fairly small neighbourhood: https://en.wikipedia.org/wiki/Postal_codes_in_Canada#Number_of_possible_postal_codes)
@PeterLudemann @jernej__s @ashwin @Dav
Stop it, you're making me jealous of Canada again.