14

I am trying to find the shapefiles for postcode sector and districts in the UK. Specifically inside London. I know I can go and pay for these but I only really need to use them once. I want to generate my own mapping tiles with the shapes on one version of the tiles. Allowing me to show all the postcode boundaries without overloading the JavaScript on the client side.

I could "redraw" some of shapes myself (tracing from others) but would be great if there were some shapefiles already out there.

Can anyone help?

1
  • 2
    If it's open data that you seek then I think the place to ask is the Open Data Stack Exchange.
    – PolyGeo
    Commented Dec 19, 2021 at 11:40

8 Answers 8

5

Someone has done it using various royalty and copyright free sources of data - see http://random.dev.openstreetmap.org/postcodes/. In my view the best is the Code-Point Opendata as it comes straight from Royal Mail. I don't think it's quite the same as the actual Royal Mail files but it's probably accurate enough. The files don't seem to be available so you could either contact the author or replicate the process, using the provided source code.

An alternative would be to download the OS OpenData Code-Point and run a tool to create Voroni Polygons on them - this is how the polygons linked are created I think. Most GIS programs should be able to accomplish this task.

4

UK postcodes don't cover polygons. They cover a set of individual delivery points which are not necessarily contiguous.

It is certainly possible, given the co-ordinates for these delivery points, to describe a polygon such that all the co-ordinates are within that polygon. However, such a polygon would not be a unique solution - there would be many polygons that could potentially fit the bill. See, Algorithm to find polygons enclosing points.

3
  • This is incorrect. The OS provide official postcode polygon data - ordnancesurvey.co.uk/business-and-government/products/…
    – Matt
    Commented Oct 31, 2018 at 11:00
  • @Matt, the page you linked to says "Code-Point with polygons shows the notional shape of every postcode unit in Great Britain". Google defines notional as "existing as or based on a suggestion, estimate, or theory; not existing in reality."
    – tobyink
    Commented Nov 26, 2018 at 21:17
  • I take this to mean UK postcodes can be polygons, just not unique ones. Commented Aug 7, 2021 at 10:04
3

You can create your own from:

Codepoint Open https://www.ordnancesurvey.co.uk/opendatadownload/products.html

Supply format: CSV

Version: 11/2013

Code-Point Open provides a precise geographic location for each postcode unit in Great Britain. The product is a CSV file containing postcodes, grid references, NHS® health and regional health authority codes, administrative ward, district, county and country area codes.

Some of this data is in WGS84 on http://parlvid.mysociety.org/os/

GB Postcode Areas or use the pre-converted (check the age of this source)

Thiessen polygons were generated from all records in OS OpenData Code-Point Open. Resulting coverage was dissolved up to postcode area level and then clipped to GB extent of the realm using OS OpenData Boundary-Line. Names of postcode areas were added from Wikipedia.

https://www.sharegeo.ac.uk/handle/10672/51?show=full

3

If you qualify for the OS PSMA (Public Sector Mapping Agreement) then you can get Codepoint with polygons for free. They provide an excellent service and it's delivered the very next day.

Have a google for PSMA to see if you qualify.

3

https://datashare.is.ed.ac.uk/handle/10283/2597

This website has the recently updated UK Postcode Area, Postcode District and Postcode Sector shapefiles in the 'GB_Postcodes.zip' file.

0

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.

0
0

I'm pretty sure that the Postcode data you want is not available for free. I believe Ordnance survey and Royal Mail are still talking about how royalties will be paid/collected when detailed Postcode data is released under the PSMA.

4
  • This is wrong - OS have already released the Code Point data (which is at individual postcode centre-point detail - sufficient to create broad boundaries). It's available here: ordnancesurvey.co.uk/opendatadownload/products.html
    – Stev_k
    Commented Aug 29, 2012 at 20:57
  • Very true Stev_k but it doesn't contain all the Royal Mail PAF data. It may be that Charlie doesn't require the PAF data but as someone who uses both I tend to think of them as one and the same, my mistake I know :)
    – nigellaw
    Commented Aug 29, 2012 at 21:05
  • hey guys, I am interested in creating the boundaries, primararily for Sector / District... @Stev_k how can i do this from the code point data which only includes the centre point? I would have to make assumptions? Commented Aug 29, 2012 at 23:29
  • You could use Voroni polygons as per my method above.
    – Stev_k
    Commented Aug 29, 2012 at 23:37
0

Ordnance survey sell a number of postcode products. You have already discovered the codePoint open product but what you are seeking is a premium data product called CodePoint with polygons. There have been some attempts to recreate the dataset using open data with varying degrees of success.

Not the answer you're looking for? Browse other questions tagged or ask your own question.