One of the main ways of generating postcode polygons is to use OS Code-Point Open and from them generate Voronoi polygons.
This visualization compares the Code-Point Voronoi polygons to postcodes from NRS postcode extract, Which is widely considered the best postcode dataset for Scotland. Scotland is used because we have a CAG (NLPG in the south) extract for Glasgow available for a property comparison of accuracy.
The black areas are where the two datasets agree and the coloured areas are where they do not. For this comparison we can consider NRS to be correct.
The Ordnance Survey releases Code-Point Open, which contains the centroid coordinates for each postcode in the UK. One way to generate open postcode polygons is to generate a Voronoi diagram from those points.
The results initially look good, but how accurate are these generated polygons compared with actual postcode polygons.
Luckily the National Records of Scotland (NRS) also maintain a postcode dataset, which is released on their website for free. So we can do an easy comparison of the two postcode datasets, which should be an indication of how accurate Voronoi postcode areas would be across the UK.
I have decided to use Glasgow for the comparison because we also have the Corporate Address Gazetteer, which will allow us to compare not just the actual polygons, but actual properties. It does not really matter if the postcode polygon is incorrect, if all of the properties within that postcode would still be correct.
Fist we have a simple side by side look at the two datasets we will compare:
And a closeup overlay:
The Voronoi one has been created from Code-Point Open points that fell within the Glasgow City Council Unitary Authority and the output Voronoi was clipped to the extent of the Unitary Authority.
The NRS created postcodes were simply selected from the ones where their “Point on Surface” fell within the Unitary Authority. The process will detailed in a later post.