Skip to content

Commit

Permalink
Update raster slides
Browse files Browse the repository at this point in the history
  • Loading branch information
cforgaci committed Jan 29, 2024
1 parent da04bc4 commit 6ddc793
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 65 deletions.
73 changes: 37 additions & 36 deletions instructors/3-raster-slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,25 @@ <h1 class="title">Intro to Geospatial Raster Data with R</h1>
<section id="outline" class="slide level2">
<h2>Outline</h2>
<ol type="1">
<li class="fragment">Intro to raster data: packages, metadata (CRS, resolution)</li>
<li class="fragment">Intro to raster data</li>
<li class="fragment">Plotting raster data</li>
<li class="fragment">Reprojecting raster data</li>
<li class="fragment">Raster calculations</li>
<li class="fragment">Working with multi-band rasters</li>
</ol>
</section>
<section>
<section id="intro-to-raster-data" class="title-slide slide level1 center">
<h1>Intro to raster data</h1>

</section>
<section id="the-raster-package" class="slide level2">
<h2>The <code>raster</code> package</h2>

<img data-src="fig/tudlib-green.png" class="r-stretch quarto-figure-center"></section>
<section id="challenge-1-2-mins" class="slide level2">
<h2>Challenge 1: 🕚 <strong>2 mins</strong></h2>
<p>Use <code>GDALinfo()</code> to determine the following about the <code>tud-dsm-hill.tif</code> file:</p>
<h2>Challenge 1: <strong>2 mins</strong></h2>
<p>Use <code>describe()</code> to determine the following about the <code>tud-dsm-hill.tif</code> file:</p>
<ol type="1">
<li class="fragment">Does this file have the same CRS as <code>DSM_TUD</code>?</li>
<li class="fragment">What is resolution of the raster data?</li>
Expand All @@ -370,79 +375,75 @@ <h2>Challenge 1: 🕚 <strong>2 mins</strong></h2>
</ol>
<div class="cell">
<div class="cell-output-display">
<div class="countdown" id="timer_0a879efb" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown" id="timer_79c04b2d" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div>
<code class="countdown-time"><span class="countdown-digits minutes">02</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
</div>
</div>
</div>
</section></section>
<section>
<section id="plotting-raster-data" class="title-slide slide level1 center">
<h1>Plotting raster data</h1>

</section>
<section id="challenge-2-5-mins" class="slide level2">
<h2>Challenge 2: 🕗 <strong>5 mins</strong></h2>
<h2>Challenge 2: <strong>5 mins</strong></h2>
<p>Create a plot of the TU Delft Digital Surface Model (<code>DSM_TUD</code>) that has:</p>
<ol type="1">
<li class="fragment">Six classified ranges of values (break points) that are evenly divided among the range of pixel values.</li>
<li class="fragment">Axis labels.</li>
<li class="fragment">A plot title.</li>
</ol>
<div class="cell">
<div class="cell-output-display">
<div class="countdown" id="timer_e766f399" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown" id="timer_a552ce61" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div>
<code class="countdown-time"><span class="countdown-digits minutes">05</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
</div>
</div>
</div>
</section></section>
<section>
<section id="reprojecting-raster-data" class="title-slide slide level1 center">
<h1>Reprojecting raster data</h1>

</section>
<section id="challenge-3-8-mins" class="slide level2">
<h2>Challenge 3: 🕑 <strong>8 mins</strong></h2>
<p>Use the <code>tud-dtm.tif</code> and <code>tud-dtm-hill.tif</code> files from the <code>data</code> directory to create a Digital Terrain Model map of the TU Delft area.</p>
<p>Make sure to:</p>
<ul>
<li class="fragment">include hillshade in the maps,</li>
<li class="fragment">label axes,</li>
<li class="fragment">include a title for each map,</li>
<li class="fragment">experiment with various alpha values and color palettes to represent the data.</li>
</ul>
<div class="cell">
<div class="cell-output-display">
<div class="countdown" id="timer_e863979c" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div>
<code class="countdown-time"><span class="countdown-digits minutes">08</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
</div>
</div>
</div>
</section>
<section id="challenge-4-2-mins" class="slide level2">
<h2>Challenge 4: 🕧 <strong>2 mins</strong></h2>
<section id="challenge-3-2-mins" class="slide level2">
<h2>Challenge 3: 🕐 <strong>2 mins</strong></h2>
<p>View the CRS for each of these two datasets. What projection does each use?</p>
<div class="cell">
<div class="cell-output-display">
<div class="countdown" id="timer_915edb97" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown" id="timer_3ba34611" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div>
<code class="countdown-time"><span class="countdown-digits minutes">02</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
</div>
</div>
</div>
</section></section>
<section>
<section id="raster-calculations" class="title-slide slide level1 center">
<h1>Raster calculations</h1>

</section>
<section id="challenge-5-5-mins" class="slide level2">
<h2>Challenge 5: 🕞 <strong>5 mins</strong></h2>
<section id="challenge-4-10-mins" class="slide level2">
<h2>Challenge 4: ⏱ <strong>10 mins</strong></h2>
<p>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.</p>
<ol type="1">
<li class="fragment">What is the min and maximum value for the Canopy Height Model <code>CHM_TUD</code> that we just created?</li>
<li class="fragment">What are two ways you can check this range of data for <code>CHM_TUD</code>?</li>
<li class="fragment">What is the min and max value for the Canopy Height Model <code>CHM_TUD</code> that we just created?</li>
<li class="fragment">What is the distribution of all the pixel values in the CHM?</li>
<li class="fragment">Plot a histogram with 6 bins instead of the default and change the color of the histogram.</li>
<li class="fragment">Plot the <code>CHM_TUD</code> raster using breaks that make sense for the data. Include an appropriate color palette for the data, plot title and no axes ticks / labels.</li>
</ol>
<div class="cell">
<div class="cell-output-display">
<div class="countdown" id="timer_1e7b0a76" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown" id="timer_b1eb286f" data-update-every="1" tabindex="0" style="right:0;bottom:0;">
<div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div>
<code class="countdown-time"><span class="countdown-digits minutes">05</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
<code class="countdown-time"><span class="countdown-digits minutes">10</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
</div>
</div>
</div>
</section></section>
<section id="working-with-multi-band-rasters" class="title-slide slide level1 center">
<h1>Working with multi-band rasters</h1>
<div class="footer footer-default">
<p>Data Carpentry for Geospatial Data</p>
</div>
Expand Down
44 changes: 15 additions & 29 deletions instructors/3-raster-slides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@ 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"}


## 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?
Expand All @@ -57,42 +59,24 @@ 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
#| cache: false
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?

Expand All @@ -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

0 comments on commit 6ddc793

Please sign in to comment.