File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ Upcoming Release
170170
171171* Misc: Automatically update the DAGs shown in the documentation (https://github.com/PyPSA/pypsa-eur/pull/1880).
172172
173+ * Fix: An issue with the download and extraction of WDPA and WDPA Marine data (https://github.com/PyPSA/pypsa-eur/issues/2005).
174+
173175PyPSA-Eur v2025.07.0 (11th July 2025)
174176=====================================
175177
Original file line number Diff line number Diff line change @@ -858,6 +858,12 @@ if (WDPA_DATASET := dataset_version("wdpa"))["source"] in [
858858 copy2 (input ["zip_file" ], output ["zip_file" ])
859859 unpack_archive (output ["zip_file" ], output_folder )
860860
861+ # Extract {bYYYY} from the input file / URL
862+ bYYYY = re .search (
863+ r"WDPA_(\w{3}\d{4})_Public_shp.zip" ,
864+ input ["zip_file" ],
865+ ).group (1 )
866+
861867 for i in range (3 ):
862868 # vsizip is special driver for directly working with zipped shapefiles in ogr2ogr
863869 layer_path = (
@@ -889,6 +895,12 @@ if (WDPA_MARINE_DATASET := dataset_version("wdpa_marine"))["source"] in [
889895 copy2 (input ["zip_file" ], output ["zip_file" ])
890896 unpack_archive (output ["zip_file" ], output_folder )
891897
898+ # Extract {bYYYY} from the input file / URL
899+ bYYYY = re .search (
900+ r"WDPA_WDOECM_(\w{3}\d{4})_Public_marine_shp.zip" ,
901+ input ["zip_file" ],
902+ ).group (1 )
903+
892904 for i in range (3 ):
893905 # vsizip is special driver for directly working with zipped shapefiles in ogr2ogr
894906 layer_path = f"/vsizip/{ output_folder } /WDPA_WDOECM_{ bYYYY } _Public_marine_shp_{ i } .zip"
You can’t perform that action at this time.
0 commit comments