Skip to content

markmclaren/inspired-postcodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Inspired Postcodes

An interactive web map for exploring GB postcode boundaries derived from open Land Registry and ONS data.

Live map: markmclaren.github.io/inspired-postcodes


What is this?

This project uses INSPIRE Index Polygon data (HM Land Registry) combined with NSUL point data (ONS) to produce polygon boundaries for GB postcodes at multiple levels of aggregation. The resulting boundaries are served as PMTiles vector tile files and rendered in the browser using MapLibre GL JS.

The approach was inspired by Mark Longair's blog post: Open Data GB Postcode Unit Boundaries

Mark's Voronoi-processed postcode data, derived from Mapit, is also available as PMTiles: github.com/markmclaren/mapit-postcode-pmtileslive viewer


Map Layers

Layer Description
Original INSPIRE All INSPIRE property boundary polygons. Where a parcel spans multiple postcodes, it is split into segments using Voronoi cells derived from UPRN coordinates.
Single Postcodes Property parcels that map cleanly to exactly one postcode.
Dissolved Postcodes Postcode unit boundaries formed by dissolving all single-postcode parcel geometries by postcode (e.g. AB10 1AB).
Sector Dissolved Postcode sector boundaries (e.g. AB10 1), formed by dissolving the unit boundaries.
District Dissolved Postcode district boundaries (e.g. AB10), formed by dissolving the sector boundaries.
Area Dissolved Top-level postcode area boundaries (e.g. AB), formed by dissolving the district boundaries.

All layers include a colour_index property (0–5) for neighbour-contrast colouring.


Data Sources

The PMTiles files are hosted on Hugging Face: huggingface.co/datasets/markmclaren/inspired-postcodes


How the Data Was Produced

The pipeline was run on the Isambard 3 HPC system. Processing steps:

  1. Download INSPIRE GML zip files (one per local authority, ~318 councils).
  2. Load each GML into DuckDB via GDAL/ST_Read.
  3. Spatially join NSUL UPRN points onto polygons to assign postcodes.
  4. For parcels containing multiple postcodes, split geometry using Voronoi cells seeded by UPRN coordinates.
  5. Export to newline-delimited GeoJSON per council.
  6. Convert each GeoJSON to MBTiles with Tippecanoe.
  7. Merge all per-council MBTiles with tile-join and convert to PMTiles.
  8. Dissolve the single-postcode layer progressively by postcode unit, sector, district, and area to produce the four dissolved layers.

Licence

Contains HM Land Registry data © Crown copyright and database right 2025.
Contains National Statistics data © Crown copyright and database right 2025.
Licensed under the Open Government Licence v3.0.

Releases

No releases published

Packages

 
 
 

Contributors