Summary
UK government database of all 1,841,177 UK postcodes together with latitude and longitude, grid references, county, district, ward, NHS codes and regions, Ordnance Survey reference, and date of introduction. The database was last updated on July 8, 2009 and is over 100,000 pages in size.
The file has literally tens of thousands of potential applications from ecology and political campaigns to medical statistics and courier services.
The database, which is compiled at tax-payer espense, has long been the subject of hitherto unsuccessful information liberation campaigns, including by the Guardian newspaper.
Selected parts of the database can be licensed, for a fee, from the Royal Mail, but the full database has been denied to the public domain, probably as an effort by the Royal Mail discourage fair competition in the postal sector.
The database is structured as a plain text file, with each entry taking one line and with distinct fields seperated by commas. The very first line specifies the order of the 17 fields of information about each postcode.
References to most of the fields are given in this Royal Mail programmer's guide.
Latitude and longitude are accurate down to 100m.
The PZ_IntroductionDate field should be 6 bytes, not 8. The additional 2 bytes appended to this field are the first 2 bytes of the following field - PZ_GridRefEast.
According to a reader, there are some thousands of postcodes with missing geographic coordinates. Government installations or just Royal Mail errors?
The original file is 241Mb. It has been compressed down to 20Mb with the free "bzip2" program, which is needed to uncompress the file to its original state.
A fast "bittorrent" download of the database is available here.
See also New Digital Master Map for Great Britian: Confidential Advice to Ministers, 2009.
The file has literally tens of thousands of potential applications from ecology and political campaigns to medical statistics and courier services.
The database, which is compiled at tax-payer espense, has long been the subject of hitherto unsuccessful information liberation campaigns, including by the Guardian newspaper.
Selected parts of the database can be licensed, for a fee, from the Royal Mail, but the full database has been denied to the public domain, probably as an effort by the Royal Mail discourage fair competition in the postal sector.
The database is structured as a plain text file, with each entry taking one line and with distinct fields seperated by commas. The very first line specifies the order of the 17 fields of information about each postcode.
References to most of the fields are given in this Royal Mail programmer's guide.
Latitude and longitude are accurate down to 100m.
The PZ_IntroductionDate field should be 6 bytes, not 8. The additional 2 bytes appended to this field are the first 2 bytes of the following field - PZ_GridRefEast.
According to a reader, there are some thousands of postcodes with missing geographic coordinates. Government installations or just Royal Mail errors?
The original file is 241Mb. It has been compressed down to 20Mb with the free "bzip2" program, which is needed to uncompress the file to its original state.
A fast "bittorrent" download of the database is available here.
See also New Digital Master Map for Great Britian: Confidential Advice to Ministers, 2009.