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