Add postcode mapping
This commit is contained in:
parent
e7f2d1ffc3
commit
4506263e5b
5 changed files with 966 additions and 0 deletions
36
pipeline/download/oa_boundaries.py
Normal file
36
pipeline/download/oa_boundaries.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""Download Output Areas (December 2021) Boundaries EW BGC (V2).
|
||||
|
||||
Generalised clipped (20m) boundary polygons for 2021 Census Output Areas
|
||||
covering England and Wales.
|
||||
|
||||
Source: https://open-geography-portalx-ons.hub.arcgis.com/datasets/ons::output-areas-december-2021-boundaries-ew-bgc-v2
|
||||
License: Open Government Licence v3.0
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from pipeline.utils import download
|
||||
|
||||
URL = "https://open-geography-portalx-ons.hub.arcgis.com/api/download/v1/items/6beafcfd9b9c4c9993a06b6b199d7e6d/geoPackage?layers=0"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Download OA 2021 boundary polygons (England & Wales)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output",
|
||||
type=Path,
|
||||
required=True,
|
||||
help="Output GeoPackage file path",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
download(URL, args.output, timeout=600)
|
||||
print(f"Saved to {args.output}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue