Skip to content

Commit

Permalink
clean assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
ElcoK committed Aug 22, 2024
1 parent 7e039ed commit 6ba7d8e
Show file tree
Hide file tree
Showing 26 changed files with 42 additions and 26,089 deletions.
File renamed without changes.
1 change: 0 additions & 1 deletion TAA1/tutorial2.ipynb

This file was deleted.

66 changes: 37 additions & 29 deletions TAA2/Combined_tutorial.ipynb → TAA2/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
"id": "cbd68ab3-f04b-434f-a956-e730535c9ee5",
"metadata": {},
"source": [
"## Summative Assignment 1: Natural Hazard Risk Assessment of Infrastructure"
"## TAA2: Natural Hazard Risk Assessment using public data"
]
},
{
"cell_type": "markdown",
"id": "4c8cc742-23a7-4895-8d2a-7e826d8a23b8",
"metadata": {},
"source": [
"Within this tutorial, we are going to use publicly available hazard data and exposure data to do a risk assessment for - AREA -. 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",
"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",
" \n",
"\n",
"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."
]
},
Expand All @@ -34,14 +33,14 @@
"metadata": {},
"source": [
"- To understand the use of **OSMnx** to extract geospatial data from OpenStreetmap.\n",
"- To know how to download data from the Copernicus Climate Data Store using the `cdsapi` and access it through Python.\n",
"- To know how to access and open information from the Copernicus Land Monitoring System. Specifically the Corine Land Cover data.\n",
"\n",
"- To be able to open and visualize this hazard data.\n",
"- To know how to rasterize vector data through using **Geocube**.\n",
"- To know how to visualise vector and raster data.\n",
"- To understand the basic functioning of **Matplotlib** to create a map.\n",
"- To know how one can generate routes between two points using **NetworkX**.\n",
"- To visualize networks on an interactive map \n",
"- To know how to download data from the Copernicus Climate Data Store using the `cdsapi` and access it through Python.\n",
"- To be able to open and visualize this hazard data.\n",
"- To know how to access and open information from the Copernicus Land Monitoring System. Specifically the Corine Land Cover data.\n",
"\n",
"- To understand the basic approach of a natural hazard risk assessment.\n",
"- To be able to use the `DamageScanner` to do a damage assessment.\n",
"- To interpret and compare the damage estimates."
Expand Down Expand Up @@ -91,6 +90,7 @@
"import matplotlib\n",
"import urllib3\n",
"import pyproj\n",
"import contextily as cx\n",
"\n",
"import osmnx as ox\n",
"import numpy as np\n",
Expand Down Expand Up @@ -140,7 +140,7 @@
"id": "d7693fcc-a0cf-4ed4-a0d0-e3a00b917547",
"metadata": {},
"source": [
"We will first download and explore windstorm and flood data for -AREA-. \n",
"We will first download and explore windstorm and flood data for the Netherlands. \n",
"\n",
"### Windstorm Data\n",
"<hr>\n",
Expand Down Expand Up @@ -238,7 +238,7 @@
"metadata": {},
"outputs": [],
"source": [
"place_name = \"Gelderland, The Netherlands\" ### CHECK IF WE WANT TO PROCEED WITH THIS LOCATION???\n",
"place_name = \"Gelderland, The Netherlands\" ### But you could also consider Zeeland, for example.\n",
"area = ox.geocode_to_gdf(place_name)"
]
},
Expand All @@ -247,7 +247,7 @@
"id": "9bd3821f-16dd-4e7b-8ac6-a46475704afd",
"metadata": {},
"source": [
"## 3. Visualising the natural hazard data\n",
"## 3. Exploring the natural hazard data\n",
"<hr>"
]
},
Expand Down Expand Up @@ -358,7 +358,7 @@
"id": "8ba5e684-f658-42e9-bded-bbb47ced24e4",
"metadata": {},
"source": [
"Following, we also make sure it will be in the European coordinate system **EPSG:3035** to ensure we can easily use it together with the other data. To do so, we use the `reproject()` function. You can simple add the number of the coordinate system."
"Following, we also make sure it will be in the European coordinate system **EPSG:3035** to ensure we can easily use it together with the other data. To do so, we use the `rio.reproject()` function. You can simple add the number of the coordinate system."
]
},
{
Expand All @@ -368,7 +368,7 @@
"metadata": {},
"outputs": [],
"source": [
"windstorm_europe = windstorm_europe.rio.reproject(XXXX)"
"windstorm_europe = windstorm_europe. [add function]"
]
},
{
Expand Down Expand Up @@ -404,7 +404,7 @@
"metadata": {},
"outputs": [],
"source": [
"windstorm_map['FX']. XXXX"
"windstorm_map['FX']. [add function]"
]
},
{
Expand All @@ -431,7 +431,7 @@
"metadata": {},
"outputs": [],
"source": [
"flood_map_path = os.path.join(data_path,'floodmap_EFAS_RP100_C.tif')"
"flood_map_path = 'floodmap_EFAS_RP100_C.tif'"
]
},
{
Expand All @@ -450,7 +450,7 @@
"id": "5eb3c24d-4ed2-4717-befc-67e52e1bbbea",
"metadata": {},
"source": [
"And let's make sure we set all the variables and the CRS correctly again to be able to open the data properly. Note that we now use **EPSG:3035**. This is the standard coordinate system for Europe, in meters (instead of degrees)."
"And let's make sure we set all the variables and the CRS correctly again to be able to open the data properly. Note that we should now use **EPSG:3035**. This is the standard coordinate system for Europe, in meters (instead of degrees)."
]
},
{
Expand All @@ -460,7 +460,7 @@
"metadata": {},
"outputs": [],
"source": [
"flood_map.rio.write_crs(3035, inplace=True)\n",
"flood_map.rio.write_crs( , inplace=True)\n",
"flood_map.rio.set_spatial_dims(x_dim=\"x\",y_dim=\"y\", inplace=True)"
]
},
Expand Down Expand Up @@ -570,7 +570,7 @@
"metadata": {},
"outputs": [],
"source": [
"CLC_location = os.path.join(data_path,'U2018_CLC2018_V2020_20u1.tif')"
"CLC_location = 'U2018_CLC2018_V2020_20u1.tif'"
]
},
{
Expand Down Expand Up @@ -598,8 +598,8 @@
"metadata": {},
"outputs": [],
"source": [
"CLC_region = CLC.rio.clip_box(minx=.....,)\n",
"CLC_region = CLC_region.rio.clip(area.geometry.values,area.crs)"
"CLC_region = CLC.rio.clip_box(\n",
"CLC_region = CLC_region.rio.clip("
]
},
{
Expand All @@ -618,7 +618,7 @@
"id": "a31c0989-e96e-4809-a24d-13ab00de751f",
"metadata": {},
"source": [
"And now we create a *color_dict* again, similarly as we did for the raster data in the previous tutorial "
"And now we create a *color_dict*, to ensure we can visualize the data properly. We use the colorscheme of Corine Land Cover. "
]
},
{
Expand All @@ -637,6 +637,14 @@
" '#A6A6FF', '#4D4DFF', '#CCCCFF', '#E6E6FF', '#A6A6E6', '#00CCF2', '#80F2E6', '#00FFA6', '#A6FFE6', '#E6F2FF']"
]
},
{
"cell_type": "markdown",
"id": "6d2c9c52",
"metadata": {},
"source": [
"The code below allows us the use the color_dict above to plot the CLC map"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -689,7 +697,7 @@
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-success\">\n",
"<b>Question 5:</b> Describe the different land-use classes within your region that you see on the Corine Land Cover map.\n",
"<b>Question 5:</b> Describe the different land-use classes within your region that you see on the Corine Land Cover map. Do you see any dominant land-use classes? \n",
"</div>"
]
},
Expand All @@ -707,7 +715,7 @@
"id": "3e0dd8ab-15e8-494d-a6fb-3861636e5ed4",
"metadata": {},
"source": [
"The first step is to define which area you want to focus on. In the cell below, you will now read \"Zoeterwoude, The Netherlands\". Change this to any area or municipality in the Netherlands that (1) you can think of and (2) will work. \n",
"The next step is to define which area you want to focus on. In the cell below, you will now read \"Kampen, The Netherlands\". Change this to any area or municipality in the Netherlands that (1) you can think of and (2) will work. \n",
"\n",
"In some cases, the function does not recognize the location. You could either try a different phrasing or try a different location. Many parts of the Netherlands should work."
]
Expand All @@ -719,7 +727,7 @@
"metadata": {},
"outputs": [],
"source": [
"place_name = \"Zoeterwoude, The Netherlands\"\n",
"place_name = \"Kampen, The Netherlands\"\n",
"area = ox.geocode_to_gdf(place_name)"
]
},
Expand Down Expand Up @@ -1036,11 +1044,11 @@
"id": "3f8bda0f-aea9-471c-af15-31d9bf2bd191",
"metadata": {},
"source": [
"As you have noticed already during the lecture, and as we will again see next week when using the Google Earth Engine, most land-use data is in raster format. \n",
"As you have noticed already during the lecture, and as we have seen during TAA1 with the Google Earth Engine, most land-use data is in raster format. \n",
"\n",
"In OpenStreetMap everything is stored in vector format. As such, the land-use information we extracted from OpenStreetMap is also in vector format. While it is not always necessary to have this information in raster format, it is useful to know how to convert your data into a raster format.\n",
"\n",
"To do so, we can make use of the **GeoCube** package, which is a newly developed Python package that can very easily convert vector data into a raster format."
"To do so, we can make use of the **GeoCube** package, which is a recently developed Python package that can very easily convert vector data into a raster format."
]
},
{
Expand Down Expand Up @@ -1087,8 +1095,8 @@
"outputs": [],
"source": [
"landuse_grid = make_geocube(\n",
" vector_data=XXXX,\n",
" output_crs=\"epsg:4326\",\n",
" vector_data=,\n",
" output_crs=,\n",
" resolution=(-XXXX, XXXX),\n",
" categorical_enums=categorical_enums\n",
")"
Expand Down Expand Up @@ -1330,7 +1338,7 @@
"id": "318a2267-4057-485c-85f1-1929896ad9ee",
"metadata": {},
"source": [
"## 5. Perform a damage assessment using Coring Land Cover\n",
"## 5. Perform a raster-based damage assessment using OSM and Corine Land Cover\n",
"<hr>"
]
},
Expand Down
2 changes: 1 addition & 1 deletion TAA3/tutorial2.ipynb → TAA3/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"tags": []
},
"source": [
"# Tutorial 2: Social Media & Valuation of Landscapes\n",
"# Tutorial: Social Media & Valuation of Landscapes\n",
"\n",
"Within this tutorial, we will work with the Flickr photo database to better understand how people value specific land use types. We will learn how to extract information from Flickr, how you can explore and visualize this, and how to use it for some basic analysis.\n",
"\n",
Expand Down
Loading

0 comments on commit 6ba7d8e

Please sign in to comment.