36 lines
1 KiB
Python
36 lines
1 KiB
Python
"""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()
|