diff --git a/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb b/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb index f9391ae..f3278a5 100644 --- a/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb +++ b/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb @@ -25,17 +25,14 @@ "import ssl\n", "import subprocess\n", "import tarfile\n", - "from io import BytesIO\n", "from pathlib import Path\n", "from urllib import request as urequest\n", - "from zipfile import ZipFile\n", + "import zipfile\n", "\n", "import dask.distributed as dd\n", "import pandas as pd\n", - "import requests\n", "from dask_gateway import Gateway\n", "from pandas_datareader import wb as dr_wb\n", - "from tqdm.auto import tqdm\n", "\n", "from sliiders import settings as sset\n", "\n", @@ -78,6 +75,7 @@ " sset.DIR_IIASA_PROJECTIONS,\n", " sset.DIR_GEOG_DATUMS_XGM2019e_WGS84,\n", " sset.DIR_GEOG_DATUMS_EGM96_WGS84,\n", + " sset.DIR_GADM,\n", "]\n", "for direc in directories_to_create:\n", " direc.mkdir(exist_ok=True, parents=True)" @@ -568,6 +566,31 @@ "urequest.urlretrieve(URL_SRTM15, SRTM15PLUS_DIRECTORY / URL_SRTM15.split(\"/\")[-1])" ] }, + { + "cell_type": "markdown", + "id": "40116a24-ac34-4a9a-884d-90d2738dda07", + "metadata": {}, + "source": [ + "### GADM v3.6" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "93bb86d9-d337-44ad-9a37-d5531f9f6beb", + "metadata": {}, + "outputs": [], + "source": [ + "URL_GADM = \"https://biogeo.ucdavis.edu/data/gadm3.6/gadm36_levels_gpkg.zip\"\n", + "PATH_GADM_ZIP = sset.DIR_GADM / URL_GADM.split('/')[-1]\n", + "urequest.urlretrieve(URL_GADM, PATH_GADM_ZIP)\n", + "\n", + "sset.PATH_GADM.parent.mkdir(exist_ok=True)\n", + "\n", + "with zipfile.ZipFile(PATH_GADM_ZIP, mode='r') as z:\n", + " z.extractall(sset.PATH_GADM.parent)" + ] + }, { "cell_type": "markdown", "id": "d5efcb44-1f60-4377-9d01-e970b918ca5e",