[GIS] England – Non-metropolitan counties and the ONSPD (Postcode data)

countyordnance-surveypostal-codeunited-kingdom

I have a large amount of data records which have a postcode on them that I'm in the process of trying to visualise on an England map.

The first map view I'm doing is naturally regional view. This is fairly trivial because the ONSPD (Ordnance Survey) postcode data has a Government regional field therefore I can lookup where each postcode belongs.

The issue I'm having is doing the same for the non-metropolitan counties that belong to each region. It seems that the ONSPD data does not seem to have a direct mapping to them. It maps to counties but those counties do not cover the whole of England.

The shapefile I have for the counties looks as such :

England Counties

As you can see, this fills the entire England map and as those of you who have experience with the English county system there are shapefiles for counties that do not cover the whole of England etc.

I tried to contact the Office for National Statistics but they were unhelpful thus far. They simply asked me to have a look at their resources. I explained how I had gone through their website and the different type of county map files. I've also looked at the documentation on the ONSPD but unable to find a county level field which every postcode in England is mapped to. The county mapping they have of the postcodes looks like this :

UK Counties

Not including the Greater London boundaries (it's boroughs) it does not map onto the above linked shapefile.

Hopefully my question has made sense and someone else who has tried to visualise data on a county level for England has had the same issue.

Best Answer

You could always get the postal code data from Wikileaks. It is dated now but hey.

https://wikileaks.org/wiki/UK_government_database_of_all_1,841,177_post_codes_together_with_precise_geographic_coordinates_and_other_information,_8_Jul_2009

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 database is structured as a plain text file, with each entry taking one line and with distinct fields separated by commas. The very first line specifies the order of the 17 fields of information about each postcode.

I do not endorse the use of leaked data.

Related Question