From 42e10861b0676f67c74957fbde80554122b82b93 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 20 Aug 2020 18:54:57 +0100 Subject: [PATCH] put geojsons etc in source_files directory just keeping things tidy --- app/broadcast_areas/create-broadcast-areas-db.py | 10 +++++----- ...nd Unitary Authorities in England and Wales.geojson | 0 .../{ => source_files}/Countries.geojson | 0 .../Electoral Wards May 2020.geojson | 0 .../Electoral Wards and Local Authorities 2020.geojson | 0 .../Local Authorities May 2020.geojson | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename app/broadcast_areas/{ => source_files}/Counties and Unitary Authorities in England and Wales.geojson (100%) rename app/broadcast_areas/{ => source_files}/Countries.geojson (100%) rename app/broadcast_areas/{ => source_files}/Electoral Wards May 2020.geojson (100%) rename app/broadcast_areas/{ => source_files}/Electoral Wards and Local Authorities 2020.geojson (100%) rename app/broadcast_areas/{ => source_files}/Local Authorities May 2020.geojson (100%) diff --git a/app/broadcast_areas/create-broadcast-areas-db.py b/app/broadcast_areas/create-broadcast-areas-db.py index 2f2973fbd..d92f97f3c 100755 --- a/app/broadcast_areas/create-broadcast-areas-db.py +++ b/app/broadcast_areas/create-broadcast-areas-db.py @@ -8,7 +8,7 @@ from notifications_utils.formatters import formatted_list from polygons import Polygons from repo import BroadcastAreasRepository -package_path = Path(__file__).resolve().parent +source_files_path = Path(__file__).resolve().parent / 'source_files' point_counts = [] @@ -58,7 +58,7 @@ simple_datasets = [ ("Countries", "country", "ctry19cd", "ctry19nm"), ] for dataset_name, dataset_name_singular, id_field, name_field in simple_datasets: - filepath = package_path / "{}.geojson".format(dataset_name) + filepath = source_files_path / "{}.geojson".format(dataset_name) dataset_id = id_field[:-2] dataset_geojson = geojson.loads(filepath.read_text()) @@ -89,10 +89,10 @@ for dataset_name, dataset_name_singular, id_field, name_field in simple_datasets # https://geoportal.statistics.gov.uk/datasets/wards-may-2020-boundaries-uk-bgc # Converted to geojson manually from SHP because of GeoJSON download limits -wards_filepath = package_path / "Electoral Wards May 2020.geojson" +wards_filepath = source_files_path / "Electoral Wards May 2020.geojson" # http://geoportal.statistics.gov.uk/datasets/ward-to-westminster-parliamentary-constituency-to-local-authority-district-december-2019-lookup-in-the-united-kingdom/data -las_filepath = package_path / "Electoral Wards and Local Authorities 2020.geojson" +las_filepath = source_files_path / "Electoral Wards and Local Authorities 2020.geojson" ward_code_to_la_mapping = { f["properties"]["WD19CD"]: f["properties"]["LAD19NM"] @@ -143,7 +143,7 @@ for f in geojson.loads(wards_filepath.read_text())["features"]: repo.insert_broadcast_areas(areas_to_add) areas_to_add = [] -las_filepath = package_path / "Local Authorities May 2020.geojson" +las_filepath = source_files_path / "Local Authorities May 2020.geojson" for feature in geojson.loads(las_filepath.read_text())["features"]: la_id = feature["properties"]["lad20cd"] diff --git a/app/broadcast_areas/Counties and Unitary Authorities in England and Wales.geojson b/app/broadcast_areas/source_files/Counties and Unitary Authorities in England and Wales.geojson similarity index 100% rename from app/broadcast_areas/Counties and Unitary Authorities in England and Wales.geojson rename to app/broadcast_areas/source_files/Counties and Unitary Authorities in England and Wales.geojson diff --git a/app/broadcast_areas/Countries.geojson b/app/broadcast_areas/source_files/Countries.geojson similarity index 100% rename from app/broadcast_areas/Countries.geojson rename to app/broadcast_areas/source_files/Countries.geojson diff --git a/app/broadcast_areas/Electoral Wards May 2020.geojson b/app/broadcast_areas/source_files/Electoral Wards May 2020.geojson similarity index 100% rename from app/broadcast_areas/Electoral Wards May 2020.geojson rename to app/broadcast_areas/source_files/Electoral Wards May 2020.geojson diff --git a/app/broadcast_areas/Electoral Wards and Local Authorities 2020.geojson b/app/broadcast_areas/source_files/Electoral Wards and Local Authorities 2020.geojson similarity index 100% rename from app/broadcast_areas/Electoral Wards and Local Authorities 2020.geojson rename to app/broadcast_areas/source_files/Electoral Wards and Local Authorities 2020.geojson diff --git a/app/broadcast_areas/Local Authorities May 2020.geojson b/app/broadcast_areas/source_files/Local Authorities May 2020.geojson similarity index 100% rename from app/broadcast_areas/Local Authorities May 2020.geojson rename to app/broadcast_areas/source_files/Local Authorities May 2020.geojson