|
19 | 19 | "source": [
|
20 | 20 | "Within this tutorial, we are going to use publicly available hazard data and exposure data to do a risk assessment for the Netherlands. More specifically, we will look at damage due to wind storms and flooding. We will use both Copernicus Land Cover data and OpenStreetMap to estimate the potential damage of natural hazards to the built environment.\n",
|
21 | 21 | "\n",
|
22 |
| - "We will first download, access and explore hazard data retrieved from the Copernicus Climate Data Copernicus Store and the European Commission Joint Research Centre. After this, we will learn how to download and access Copernicus Land Cover data. We will also explore the power of OpenStreetMap that provides vector data. We will learn how to extract information from OpenStreetMap, how you can explore and visualize this. Lastly, we will use Copernicus Land Cover data to estimate the damage to specific land-uses, whereas we will use OpenStreetMap to assess the potential damage to the road system." |
| 22 | + "We will first download, access and explore hazard data retrieved from the Copernicus Climate Data Copernicus Store and the European Commission Joint Research Centre. We will also explore the power of OpenStreetMap that provides vector data. We will learn how to extract information from OpenStreetMap, how you can explore and visualize this. Lastly, we will use Copernicus Land Cover data to estimate the damage to specific land-uses, whereas we will use OpenStreetMap to assess the potential damage to the road system." |
23 | 23 | ]
|
24 | 24 | },
|
25 | 25 | {
|
|
112 | 112 | "import pandas as pd\n",
|
113 | 113 | "import matplotlib.pyplot as plt\n",
|
114 | 114 | "import networkx as nx\n",
|
| 115 | + "import cdsapi\n", |
115 | 116 | "\n",
|
116 | 117 | "from matplotlib.colors import LinearSegmentedColormap,ListedColormap\n",
|
117 | 118 | "from matplotlib.patches import Patch\n",
|
|
148 | 149 | },
|
149 | 150 | "outputs": [],
|
150 | 151 | "source": [
|
151 |
| - " # provide code to pip install missing packages\n", |
152 | 152 | " !pip install cdsapi\n",
|
153 | 153 | " !pip install geocube\n",
|
154 | 154 | " !pip install contextily\n",
|
155 |
| - " !pip install --pre osmnx" |
| 155 | + " !pip install --pre osmnx\n", |
| 156 | + " !pip install 'cdsapi>=0.7.0'" |
156 | 157 | ]
|
157 | 158 | },
|
158 | 159 | {
|
|
182 | 183 | "\n",
|
183 | 184 | "We will do so using an **API**, which is the acronym for application programming interface. It is a software intermediary that allows two applications to talk to each other. APIs are an accessible way to extract and share data within and across organizations. APIs are all around us. Every time you use a rideshare app, send a mobile payment, or change the thermostat temperature from your phone, you’re using an API.\n",
|
184 | 185 | "\n",
|
185 |
| - "However, before we can access this **API**, we need to take a few steps. Most importantly, we need to register ourselves on the [Copernicus Climate Data Store](https://cds.climate.copernicus.eu/) portal. \n", |
| 186 | + "However, before we can access this **API**, we need to take a few steps which can be found on the [CDSAPI setup webpage of the Copernicus Climate Data Store](https://cds-beta.climate.copernicus.eu/how-to-api/). The first step is to register yourself on the [Copernicus Climate Data Store](https://cds.climate.copernicus.eu/) portal. \n", |
186 | 187 | "\n",
|
187 |
| - "Now, the next step is to access the API. You can now login on the website of the [Copernicus Climate Data Store](https://cds.climate.copernicus.eu/). After you login, you can click on your name in the top right corner of the webpage (next to the login button). On the personal page that has just opened, you will find your user ID (**uid**) and your personal **API**. You need to add those in the cell below to be able to download the windstorm.\n", |
| 188 | + "Now, the next step is to request access to the dataset. As you can see in the cell below, we download a specific windstorm that has occured on the 28th of October in 2013. This is storm [Carmen (also called St Jude)](https://en.wikipedia.org/wiki/St._Jude_storm). To download the relevant windstorm data, fill out the associated [dataset form](https://cds-beta.climate.copernicus.eu/datasets/sis-european-wind-storm-indicators?tab=download) and make sure to **agree to the Terms of Use**. \n", |
188 | 189 | "\n",
|
189 |
| - "As you can see in the cell below, we download a specific windstorm that has occured on the 28th of October in 2013. This is storm [Carmen (also called St Jude)](https://en.wikipedia.org/wiki/St._Jude_storm)." |
| 190 | + "The last step is to access the API. You can now login on the website of the [Copernicus Climate Data Store](https://cds.climate.copernicus.eu/). After you login, you can click on your name in the top right corner of the webpage (next to the login button). On the personal page that has just opened, you will find your personal access token **API**. You need to add this in the cell below to be able to download the windstorm." |
190 | 191 | ]
|
191 | 192 | },
|
192 | 193 | {
|
|
202 | 203 | },
|
203 | 204 | "outputs": [],
|
204 | 205 | "source": [
|
205 |
| - "uid = 76974\n", |
206 |
| - "apikey = 'ace04e3e-84e3-4d0c-ae9d-d248aca1f5e5'\n", |
207 |
| - "\n", |
208 |
| - "c = cdsapi.Client(key=f\"{uid}:{apikey}\", url=\"https://cds.climate.copernicus.eu/api/v2\")\n", |
209 |
| - "\n", |
| 206 | + "apikey = '' #add your personal API\n", |
| 207 | + " \n", |
| 208 | + "c = cdsapi.Client(key=f\"{apikey}\", url=\"https://cds-beta.climate.copernicus.eu/api\")\n", |
| 209 | + " \n", |
210 | 210 | "c.retrieve(\n",
|
211 | 211 | " 'sis-european-wind-storm-indicators',\n",
|
212 | 212 | " {\n",
|
|
695 | 695 | "id": "672472d8-aff1-498f-ac36-41082ac32c4e"
|
696 | 696 | },
|
697 | 697 | "source": [
|
698 |
| - "Unfortunately, there is no API option to download the [Corine Land Cover](https://land.copernicus.eu/pan-european/corine-land-cover) data. We will have to download the data from the website first.\n", |
| 698 | + "We will now download the [Corine Land Cover](https://land.copernicus.eu/pan-european/corine-land-cover) data.\n", |
699 | 699 | "\n",
|
700 |
| - "To do so, we will first have to register ourselves again on the website. Now click on the Login button in the top right corner to login on the website. There are many interesting datasets on this website, but we just want to download the Corine Land Cover data, and specifically the latest version: [Corine Land Cover 2018](https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=download). To do so, please select the **Corine Land Cover - 100 meter**. Now click on the large green Download button. Your download should start any minute.\n", |
| 700 | + "To do so, we will first have to register ourselves again on the website. Now click on the Login button in the top right corner to login on the website. There are many interesting datasets on this website, but we just want to download the Corine Land Cover data, and specifically the latest version: [Corine Land Cover 2018](https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=download). To do so, click on the large green Download button. Now please select the **Corine Land Cover - 100 meter** and add this to your cart. Next, go to your cart and click on Process download request. After this, the requested data can be downloaded via the 'downloading process page'. After hitting Download file, your download should start any minute.\n", |
701 | 701 | "\n",
|
702 |
| - "Slightly annoying, the file you have downloaded is double zipped. Its slightly inconvenient to open this through Python and within Google Drive. So let's unzip it twice outside of Python (on your local machine) and then direct yourself to the `DATA` directory within the unzipped file. Here you can find a file called `U2018_CLC2018_V2020_20u1.tif`. Drop this file into this notebook's directory." |
| 702 | + "Slightly annoying, the file you have downloaded is double zipped. Its slightly inconvenient to open this through Python and within Google Drive. So let's unzip it twice outside of Python (on your local machine) and then direct yourself to the `DATA` directory within the unzipped file. Here you can find a file called `U2018_CLC2018_V2020_20u1.tif`. Drop this file into this week's data directory, as specified at the start of this tutorial when we mounted our Google Drive." |
703 | 703 | ]
|
704 | 704 | },
|
705 | 705 | {
|
|
1349 | 1349 | "outputs": [],
|
1350 | 1350 | "source": [
|
1351 | 1351 | "landuse_grid = make_geocube(\n",
|
1352 |
| - " vector_data= ## add landuse,\n", |
1353 |
| - " output_crs= ## add CRS,\n", |
1354 |
| - " resolution= ## add resolution,\n", |
1355 |
| - " categorical_enums= ## add categorical_enums,\n", |
| 1352 | + " vector_data= ,## add landuse\n", |
| 1353 | + " output_crs= ,## add CRS\n", |
| 1354 | + " resolution= ,## add resolution\n", |
| 1355 | + " categorical_enums= ## add categorical_enums\n", |
1356 | 1356 | ")"
|
1357 | 1357 | ]
|
1358 | 1358 | },
|
|
1692 | 1692 | "source": [
|
1693 | 1693 | "To calculate the potential damage to both windstorms and floods, we use stage-damage curves, which relate the intensity of the hazard to the fraction of maximum damage that can be sustained by a certain land use. As you can see on the Corine Land Cover map that we just plotted, there are a lot of land use classes (44), though not all will suffer damage from either the windstorm or the flood event. For each of the land-use classes a curve and a maximum damage number are assigned.\n",
|
1694 | 1694 | "\n",
|
1695 |
| - "To Assess the damage for both the flood and windstorm event, we are going to make use of the [DamageScanner](https://damagescanner.readthedocs.io/en/latest/), which is a tool to calculate potential flood damages based on inundation depth and land use using depth-damage curves in the Netherlands. The DamageScanner was originally developed for the 'Netherlands Later' project [(Klijn et al., 2007)](https://www.rivm.nl/bibliotheek/digitaaldepot/WL_rapport_Overstromingsrisicos_Nederland.pdf). The original land-use classes were based on the Land-Use Scanner in order to evaluate the effect of future land-use change on flood damages. We have tailored the input of the DamageScanner to make sure it can estimate the damages using Corine Land Cover.\n", |
| 1695 | + "To assess the damage for both the flood and windstorm event, we are going to make use of the [DamageScanner](https://damagescanner.readthedocs.io/en/latest/), which is a tool to calculate potential flood damages based on inundation depth and land use using depth-damage curves in the Netherlands. The DamageScanner was originally developed for the 'Netherlands Later' project [(Klijn et al., 2007)](https://www.rivm.nl/bibliotheek/digitaaldepot/WL_rapport_Overstromingsrisicos_Nederland.pdf). The original land-use classes were based on the Land-Use Scanner in order to evaluate the effect of future land-use change on flood damages. We have tailored the input of the DamageScanner to make sure it can estimate the damages using Corine Land Cover.\n", |
1696 | 1696 | "\n",
|
1697 | 1697 | "Because the simplicity of the model, we can use this for any raster-based hazard map with some level of intensity. Hence, we can use it for both hazards."
|
1698 | 1698 | ]
|
|
2262 | 2262 | "id": "C7zUFEoZ6Yzn"
|
2263 | 2263 | },
|
2264 | 2264 | "source": [
|
2265 |
| - "So the first column of our damage curves relates to \"111: Continuous urban fabric\", and so on. Now let's have a look at the land uses we have within our OSM data. Can you find all the unique values in our 'landuse' column op of the **landuse** dataframe?" |
| 2265 | + "So the first column of our damage curves relates to \"111: Continuous urban fabric\", and so on. Now let's have a look at the land uses we have within our OSM data. Can you find all the unique values in our 'landuse' column of the **landuse** dataframe?" |
2266 | 2266 | ]
|
2267 | 2267 | },
|
2268 | 2268 | {
|
|
2286 | 2286 | "id": "qUJ7GwF_6vGf"
|
2287 | 2287 | },
|
2288 | 2288 | "source": [
|
2289 |
| - "Our next step would be to attach a value to each of that land-use class that corresponds to the value of each column (to make sure we have a damage curve linked to each land-use class)" |
| 2289 | + "Our next step would be to attach a value to each of the land-use classes that corresponds to the value of each column (to make sure we have a damage curve linked to each land-use class)" |
2290 | 2290 | ]
|
2291 | 2291 | },
|
2292 | 2292 | {
|
|
2784 | 2784 | "id": "508022f5-46d7-4c69-91d2-46711d6a514c"
|
2785 | 2785 | },
|
2786 | 2786 | "source": [
|
2787 |
| - "## 6. Perform a damage assessment of the road network using OpenStreetMap\n", |
| 2787 | + "## 7. Perform a damage assessment of the road network using OpenStreetMap\n", |
2788 | 2788 | "<hr>"
|
2789 | 2789 | ]
|
2790 | 2790 | },
|
|
3326 | 3326 | "name": "python",
|
3327 | 3327 | "nbconvert_exporter": "python",
|
3328 | 3328 | "pygments_lexer": "ipython3",
|
3329 |
| - "version": "3.12.3" |
| 3329 | + "version": "3.11.9" |
3330 | 3330 | }
|
3331 | 3331 | },
|
3332 | 3332 | "nbformat": 4,
|
|
0 commit comments