From 6ddc7934b09b5ecb80932c2c4d9a1ed1b08f1d72 Mon Sep 17 00:00:00 2001 From: Claudiu Forgaci Date: Mon, 29 Jan 2024 11:07:05 +0100 Subject: [PATCH] Update raster slides --- instructors/3-raster-slides.html | 73 ++++++++++++++++---------------- instructors/3-raster-slides.qmd | 44 +++++++------------ 2 files changed, 52 insertions(+), 65 deletions(-) diff --git a/instructors/3-raster-slides.html b/instructors/3-raster-slides.html index 0075ed56..543160c6 100644 --- a/instructors/3-raster-slides.html +++ b/instructors/3-raster-slides.html @@ -348,20 +348,25 @@

Intro to Geospatial Raster Data with R

Outline

    -
  1. Intro to raster data: packages, metadata (CRS, resolution)
  2. +
  3. Intro to raster data
  4. Plotting raster data
  5. Reprojecting raster data
  6. Raster calculations
  7. Working with multi-band rasters
+
+
+
+

Intro to raster data

+

The raster package

-

Challenge 1: πŸ•š 2 mins

-

Use GDALinfo() to determine the following about the tud-dsm-hill.tif file:

+

Challenge 1: ⏰ 2 mins

+

Use describe() to determine the following about the tud-dsm-hill.tif file:

  1. Does this file have the same CRS as DSM_TUD?
  2. What is resolution of the raster data?
  3. @@ -370,79 +375,75 @@

    Challenge 1: πŸ•š 2 mins

-
+
02:00
+
+
+
+

Plotting raster data

+
-

Challenge 2: πŸ•— 5 mins

+

Challenge 2: ⏰ 5 mins

Create a plot of the TU Delft Digital Surface Model (DSM_TUD) that has:

  1. Six classified ranges of values (break points) that are evenly divided among the range of pixel values.
  2. -
  3. Axis labels.
  4. A plot title.
-
+
05:00
+
+
+
+

Reprojecting raster data

+
-
-

Challenge 3: πŸ•‘ 8 mins

-

Use the tud-dtm.tif and tud-dtm-hill.tif files from the data directory to create a Digital Terrain Model map of the TU Delft area.

-

Make sure to:

-
    -
  • include hillshade in the maps,
  • -
  • label axes,
  • -
  • include a title for each map,
  • -
  • experiment with various alpha values and color palettes to represent the data.
  • -
-
-
-
-
-08:00 -
-
-
-
-
-

Challenge 4: πŸ•§ 2 mins

+
+

Challenge 3: πŸ• 2 mins

View the CRS for each of these two datasets. What projection does each use?

-
+
02:00
+
+
+
+

Raster calculations

+
-
-

Challenge 5: πŸ•ž 5 mins

+
+

Challenge 4: ⏱ 10 mins

It’s often a good idea to explore the range of values in a raster dataset just like we might explore a dataset that we collected in the field.

    -
  1. What is the min and maximum value for the Canopy Height Model CHM_TUD that we just created?
  2. -
  3. What are two ways you can check this range of data for CHM_TUD?
  4. +
  5. What is the min and max value for the Canopy Height Model CHM_TUD that we just created?
  6. What is the distribution of all the pixel values in the CHM?
  7. -
  8. Plot a histogram with 6 bins instead of the default and change the color of the histogram.
  9. Plot the CHM_TUD raster using breaks that make sense for the data. Include an appropriate color palette for the data, plot title and no axes ticks / labels.
-
+
-05:00 +10:00
+
+
+

Working with multi-band rasters

diff --git a/instructors/3-raster-slides.qmd b/instructors/3-raster-slides.qmd index e97d2b80..2d5b94d4 100644 --- a/instructors/3-raster-slides.qmd +++ b/instructors/3-raster-slides.qmd @@ -30,13 +30,15 @@ knitr::opts_chunk$set( ## Outline -1. Intro to raster data: packages, metadata (CRS, resolution) +1. Intro to raster data 2. Plotting raster data 3. Reprojecting raster data 4. Raster calculations 5. Working with multi-band rasters +# Intro to raster data + ## The `raster` package ![](fig/tudlib-green.png){fig-align="center"} @@ -44,7 +46,7 @@ knitr::opts_chunk$set( ## Challenge 1: `r emo::ji("clock")` **2 mins** -Use `GDALinfo()` to determine the following about the `tud-dsm-hill.tif` file: +Use `describe()` to determine the following about the `tud-dsm-hill.tif` file: 1. Does this file have the same CRS as `DSM_TUD`? 2. What is resolution of the raster data? @@ -57,15 +59,14 @@ Use `GDALinfo()` to determine the following about the `tud-dsm-hill.tif` file: countdown::countdown(minutes = 2) ``` - +# Plotting raster data ## Challenge 2: `r emo::ji("clock")` **5 mins** Create a plot of the TU Delft Digital Surface Model (`DSM_TUD`) that has: 1. Six classified ranges of values (break points) that are evenly divided among the range of pixel values. -2. Axis labels. -3. A plot title. +2. A plot title. ``` {r} #| echo: false @@ -73,26 +74,9 @@ Create a plot of the TU Delft Digital Surface Model (`DSM_TUD`) that has: countdown::countdown(minutes = 5) ``` +# Reprojecting raster data - -## Challenge 3: `r emo::ji("clock")` **8 mins** - -Use the `tud-dtm.tif` and `tud-dtm-hill.tif` files from the `data` directory to create a Digital Terrain Model map of the TU Delft area. - -Make sure to: - -- include hillshade in the maps, -- label axes, -- include a title for each map, -- experiment with various alpha values and color palettes to represent the data. - -``` {r} -#| echo: false -#| cache: false -countdown::countdown(minutes = 8) -``` - -## Challenge 4: `r emo::ji("clock")` **2 mins** +## Challenge 3: `r emo::ji("clock")` **2 mins** View the CRS for each of these two datasets. What projection does each use? @@ -102,18 +86,20 @@ View the CRS for each of these two datasets. What projection does each use? countdown::countdown(minutes = 2) ``` -## Challenge 5: `r emo::ji("clock")` **5 mins** +# Raster calculations + +## Challenge 4: `r emo::ji("clock")` **10 mins** It’s often a good idea to explore the range of values in a raster dataset just like we might explore a dataset that we collected in the field. -1. What is the min and maximum value for the Canopy Height Model `CHM_TUD` that we just created? -2. What are two ways you can check this range of data for `CHM_TUD`? +1. What is the min and max value for the Canopy Height Model `CHM_TUD` that we just created? 3. What is the distribution of all the pixel values in the CHM? -4. Plot a histogram with 6 bins instead of the default and change the color of the histogram. 5. Plot the `CHM_TUD` raster using breaks that make sense for the data. Include an appropriate color palette for the data, plot title and no axes ticks / labels. ``` {r} #| echo: false #| cache: false -countdown::countdown(minutes = 5) +countdown::countdown(minutes = 10) ``` + +# Working with multi-band rasters