Skip to content

Commit

Permalink
Updated back to 01m resolution. takes longer.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyxng committed Jan 9, 2025
1 parent 320fe25 commit a41ff56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ rule build_shapes:
countries=config_provider("countries"),
input:
eez=ancient("data/eez/World_EEZ_v12_20231025_LR/eez_v12_lowres.gpkg"),
nuts3_2021="data/nuts/NUTS_RG_03M_2021_4326_LEVL_3.geojson",
nuts3_2021="data/nuts/NUTS_RG_01M_2021_4326_LEVL_3.geojson",
ba_adm1="data/osm-boundaries/build/BA_adm1.geojson",
md_adm1="data/osm-boundaries/build/MD_adm1.geojson",
ua_adm1="data/osm-boundaries/build/UA_adm1.geojson",
Expand Down
14 changes: 7 additions & 7 deletions rules/retrieve.smk
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ if config["enable"]["retrieve"]:
rule retrieve_nuts_2021_shapes:
input:
shapes=storage(
"https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/ref-nuts-2021-03m.geojson.zip"
"https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/ref-nuts-2021-01m.geojson.zip"
),
output:
shapes_level_3="data/nuts/NUTS_RG_03M_2021_4326_LEVL_3.geojson",
shapes_level_2="data/nuts/NUTS_RG_03M_2021_4326_LEVL_2.geojson",
shapes_level_1="data/nuts/NUTS_RG_03M_2021_4326_LEVL_1.geojson",
shapes_level_0="data/nuts/NUTS_RG_03M_2021_4326_LEVL_0.geojson",
shapes_level_3="data/nuts/NUTS_RG_01M_2021_4326_LEVL_3.geojson",
shapes_level_2="data/nuts/NUTS_RG_01M_2021_4326_LEVL_2.geojson",
shapes_level_1="data/nuts/NUTS_RG_01M_2021_4326_LEVL_1.geojson",
shapes_level_0="data/nuts/NUTS_RG_01M_2021_4326_LEVL_0.geojson",
params:
zip_file="data/nuts/ref-nuts-2021-03m.geojson.zip",
zip_file="data/nuts/ref-nuts-2021-01m.geojson.zip",
run:
os.rename(input.shapes, params.zip_file)
with ZipFile(params.zip_file, "r") as zip_ref:
for level in ["LEVL_3", "LEVL_2", "LEVL_1", "LEVL_0"]:
filename = f"NUTS_RG_03M_2021_4326_{level}.geojson"
filename = f"NUTS_RG_01M_2021_4326_{level}.geojson"
zip_ref.extract(filename, Path(output.shapes_level_0).parent)
extracted_file = Path(output.shapes_level_0).parent / filename
extracted_file.rename(
Expand Down

0 comments on commit a41ff56

Please sign in to comment.