Add postcode mapping

This commit is contained in:
Andras Schmelczer 2026-02-07 19:28:57 +00:00
parent e7f2d1ffc3
commit 4506263e5b
5 changed files with 966 additions and 0 deletions

View file

@ -25,6 +25,10 @@ vars:
POSTCODES_OUTPUT: "{{.DATA_DIR}}/postcodes"
GEOSURE_OUTPUT: "{{.DATA_DIR}}/geosure"
GEOSURE_PARQUET: "{{.DATA_DIR}}/geosure.parquet"
INSPIRE_OUTPUT: "{{.DATA_DIR}}/inspire"
OA_BOUNDARIES_OUTPUT: "{{.DATA_DIR}}/oa_boundaries.gpkg"
UPRN_LOOKUP_OUTPUT: "{{.DATA_DIR}}/uprn_lookup.parquet"
POSTCODE_BOUNDARIES_OUTPUT: "{{.DATA_DIR}}/postcode_boundaries"
tasks:
download:tiles:
@ -216,6 +220,43 @@ tasks:
cmds:
- uv run python -m pipeline.transform.transform_geosure --geosure {{.GEOSURE_OUTPUT}} --arcgis {{.ARCGIS_OUTPUT}} --output {{.GEOSURE_PARQUET}}
download:inspire:
desc: Download INSPIRE Index Polygon GML files from HM Land Registry
status:
- test -d {{.INSPIRE_OUTPUT}}
cmds:
- uv run python -m pipeline.download.inspire --output {{.INSPIRE_OUTPUT}}
download:oa-boundaries:
desc: Download Output Areas (2021) boundary polygons (England & Wales)
status:
- test -f {{.OA_BOUNDARIES_OUTPUT}}
cmds:
- uv run python -m pipeline.download.oa_boundaries --output {{.OA_BOUNDARIES_OUTPUT}}
download:uprn-lookup:
desc: Download National Statistics UPRN Lookup and convert to parquet
status:
- test -f {{.UPRN_LOOKUP_OUTPUT}}
cmds:
- uv run python -m pipeline.download.uprn_lookup --output {{.UPRN_LOOKUP_OUTPUT}}
transform:postcode-boundaries:
desc: Generate postcode boundary polygons from OA boundaries + INSPIRE + UPRNs
deps:
- download:oa-boundaries
- download:inspire
- download:uprn-lookup
status:
- test -d {{.POSTCODE_BOUNDARIES_OUTPUT}}/units
cmds:
- >-
uv run python -m pipeline.transform.postcode_boundaries
--uprn {{.UPRN_LOOKUP_OUTPUT}}
--oa-boundaries {{.OA_BOUNDARIES_OUTPUT}}
--inspire {{.INSPIRE_OUTPUT}}
--output {{.POSTCODE_BOUNDARIES_OUTPUT}}
download:journey-times:
desc: "Fetch TfL journey times: task download:journey-times"
deps: