Tuesday concept lecture, Week 6. Today is raster: what a grid of cells actually is, and what you can do by adding grids together. The image on the right is a student's finished engineering-paper suitability map from Winter 2025 (credit: Rachel Partington). We build one of those in the first half of class. Thursday is the QGIS session in the Thursday hands-on session.
Reading is GIS Fundamentals: the raster sections of Chapter 2 and all of Chapter 10, Raster Analysis. This lecture follows the same ground.
Same pattern as Day 2: see it first, then name it. Students spend the next 25 to 30 minutes doing a full raster suitability analysis on engineering paper with a pencil. Every term in the second half of the lecture (cell, resolution, reclassify, map algebra, weighted overlay) will point back at what they drew.
Frame it as a real siting problem. Ask: how would you answer "where should it go?" with the vector tools from last week? You would end up intersecting a lot of polygons. Raster lets you score every location in the state at once.
Point out that these are exactly four map layers, and that each one has to be turned into a number in every cell before they can be combined. That conversion is called reclassification, and we name it later.
Walk the room. The common mistake is leaving cells blank; insist that every cell gets a number. That is the whole point of a raster: it is completely filled in.
A one-cell buffer on this grid is a real distance: ask them what one cell is worth in miles given that the sheet covers all of Utah. That number is the cell size, or resolution, and it decides how good the answer can possibly be.
This is the first layer where the numbers are a ranking rather than a yes/no. Ask why land cost pushes the score up as you move away, and whether that is really true for every kind of development.
Note that temperature is a continuous surface in reality, and the students have just binned it into five classes. That is reclassification of a continuous raster into a discrete one, done with a pencil.
Credit for this example map: Rachel Partington, Winter 2025. Ask two groups who chose different rules to compare results. Multiplying makes any zero fatal, which is exactly right for "must be in the state" and "must be near a freeway"; adding lets a strong score on one criterion rescue a zero somewhere else. There is no single correct answer, and that is the lesson.
Collect this today. It is quick credit and it gives you a record of who was in class and who understood the combination step.
Recap out loud before moving on: the squares are cells, the sheet is the extent, the width of one square is the resolution, "outside the state" was your no-data area, turning temperature into 1 to 5 was reclassification, and adding or multiplying the four sheets was map algebra.
Figure from the Data Carpentry geospatial lesson. Zoom in far enough on any aerial image and it stops being a picture and becomes a table of numbers. That is all a raster ever is.
The figure: real 150 m elevation cells from the Timpanogos summit ridge (USGS 3DEP, NAD83 / UTM zone 12N), 6 rows by 8 columns, with the (X, Y) origin at the lower-left corner. 3DEP has no gaps there, so the three no-data cells in the corner are real cells masked to stand for cells outside a clip boundary. The right half makes the second point: the number in the cell is the elevation, and the color is only symbology applied to it; a new color scheme is a new picture of the same numbers. That is Thursday's symbology work. Figure carried over from the CE 414 Week 5 deck (built there by tools/week05_terrain_figures.py) on 2026-10-05, replacing a hand-built HTML table.
Insist on the difference between a no-data cell and a cell whose value is zero. On the engineering paper, cells outside Utah were given a real 0 that means "unsuitable", which is a value; a no-data cell means the software should not compute with it at all. Mixing the two is the single most common raster bug students hit in the lab. In QGIS you can see all four of these on the Information tab of the layer properties, which is the first thing we look at on Thursday.
Four panels: land use and roads are discrete, meaning the number is a code for a category and the boundaries between classes are real edges. The DEM and the aerial image are continuous: the value changes a little from every cell to its neighbor and there is no edge.
Left: a land use raster, where 22, 41, 81 and 91 are codes, not quantities. Averaging them would be meaningless. Right: an elevation surface, where averaging neighboring cells is a perfectly sensible thing to do. The test is whether arithmetic on the values means anything.
Continuous: B and D. Discrete: A, C and E. The one that does not really belong in a raster is C, county boundaries: it is a small number of large, crisply bounded areas with sharp legal edges, which is exactly the case vector handles better. Storing a county as a grid gives you a stair-stepped border and a lot of wasted cells, which is the Colorado raster from Day 2 all over again.
Precipitation, mean July temperature, and vapour pressure deficit, all from PRISM at Oregon State. Bottom right is the mental model: several coincident grids stacked, each cell of one lining up exactly with a cell of the others. Ask what else is continuous. pH, air pressure, salinity, population density, travel time, noise.
The top figure is the key one: real world features, forest, road, water, house, get sampled into a grid where every cell takes the code of whatever dominates it. Notice how much is lost. The road becomes a staircase, a house becomes a single cell. The bottom figure shows that a discrete raster can carry a table just like a vector layer: one row per value, with a count of cells, and area is just count times cell area (30 m cells, so 900 square meters each). The gray no-data cells get no row at all: no-data is not a class and not a value.
Figures carried over from the CE 414 Week 3 deck on 2026-10-05. They are redrawn SVGs, replacing ras-features-to-raster.jpg and ras-discrete-attribute-table.jpg, which came across in the migration with no recorded source. The counts in the table are the real counts of the grid drawn beside it.
The figure shows the same landscape three ways: real world at the bottom, vector in the middle, raster on top. The raster version is the crudest and the fastest. Point out that the whole grid is just a 2D array in memory, so every operation is a loop over an array, which is why raster analysis scales to continent-sized problems.
"Correcter" is how the saying is actually passed around in the GIS community, and it is what the banner in the photo says, so the slide matches it. If someone objects to the word, that is a fine way into the argument. Let them argue for two or three minutes.
Half true and out of date. Raster really is faster, because it is array arithmetic with no topology to maintain. "Vector is correcter" only holds for discrete features with crisp boundaries: parcels, pipes, roads, wells. For a continuous surface, vector is not more correct, it is close to unusable. The honest version is that the data model should match the phenomenon, which is the Day 2 lesson again.
The four panels are one continuous surface being reclassified progressively down to a two-class mask. In QGIS these live in the Processing Toolbox under Raster analysis: Reclassify by table, Reclassify by layer, and under Raster extraction: Clip raster by mask layer. Masking is the raster cousin of the CLIP tool you used on vector data. On coordinate systems: two rasters in different CRSs will still line up on screen because QGIS reprojects for display, but map algebra between them gives garbage. Reproject first with Warp (Reproject).
Left panel (a) is unary: multiply every cell of one layer by 2. Right panel (b) is binary: add layer A to layer B, cell by cell, to get a sum layer. This is precisely what the class did when they stacked the four engineering-paper sheets. In QGIS the tool is the Raster Calculator, on the Raster menu, and there is a Processing-Toolbox version too.
Walk one cell: row 3, column 2 of A is 2, of B is 3, so the answer is 5, and nothing else on either grid was consulted. Then the hole: B has a no-data cell, so the answer has a no-data cell in the same place. This is the whole of local map algebra; everything else is which operation you put between the grids. It is also exactly what they did holding four sheets of engineering paper together, which is the next slide. Figure carried over from the CE 414 Week 3 deck.
Addition gives B, 1. Multiplication gives A, 0. That difference is the whole design decision: multiplying treats "outside the state" as a veto that nothing can overcome, while adding treats it as one lost point. Ask which one they would actually want for the water park, and whether any of them noticed this while combining their sheets.
The figure shows two grids with different origins and different cell sizes; cell A and cell B overlap partly, so there is no clean cell-to-cell correspondence. QGIS will resample for you if you let it, but it will pick the resampling rule, and nearest neighbor on a land-cover raster is right while nearest neighbor on elevation throws away accuracy. Fix it deliberately: reproject and align the grids before the Raster Calculator, not after. The engineering-paper analogue is holding two sheets up to the light and finding the squares do not line up.
The image is a shaded relief, which is itself a derived product, not the DEM. Make the DEM vs DSM distinction concrete: for a drainage study you want bare earth, for a viewshed or a solar study you want the surface with buildings on it. If they download the wrong one their culverts will drain through the trees.
A 3 km square just east of campus: Rock Canyon, Y Mountain, the Y trail. Each panel is a real downloaded product at its own native cells, not one DEM resampled four ways: SRTM 3 arc-second, USGS 3DEP 1 arc-second and 1/3 arc-second, and 3DEP 1 m lidar. Ask the room which panel they could plan a trail from, and which one they could size a culvert from. At 90 m, Rock Canyon is a smudge; at 1 m you can see the trail switchbacks. Tie it back to the engineering paper: one square of their sheet was tens of kilometers, coarser than the left-hand panel. Nothing smaller than a cell exists in the data. Figure carried over from the CE 414 Week 5 deck (built there by tools/week05_dem_sources.py), downsized to 2000 px wide.
The neighborhood is usually the eight cells surrounding each cell: slope and aspect are fitted to that 3x3 window. Emphasise that the input to every one of these is a single DEM: no extra data is collected, the information was already in the grid. This is the payoff of the raster model and the reason hydrology is done in raster. The right-hand figure is the Utah County DEM from Week 2 run through two of these tools in QGIS: a hillshade with 200 m contours on the left, slope in degrees on the right, both over the Wasatch Front east of Provo. In QGIS these are all in the Processing Toolbox: Raster analysis gives you Slope, Aspect and Hillshade, Raster extraction gives you Contour, and the GDAL and SAGA providers give the hydrology tools.
Cut and fill is the cleanest example of binary map algebra a civil student will ever see: proposed grade minus existing grade, times the cell area, summed over the site, gives you a volume. If time is short, this is the slide to spend it on.
Preview of Thursday. The Thursday session The Information tab is where today's four defining properties, cell size, extent, rows and columns, and no-data, stop being abstract.
Confirm the Quiz 5 and Lab 5 due dates on Learning Suite before class. The Belonging Map experience is also due this week.
Conversion notes (2026-09-02): source deck "114 - Raster Analysis and Map Algebra.pptx" (Feb 2025), 19 slides, none hidden. All 19 source slides are represented. Dropped media: the BYU logo EMF from the title slide (the theme carries the branding), the two dated ArcView 3.x screenshots on the "Why we use raster GIS" slide (a 3D terrain view and a 3D Seattle view), and the Excel 97 screenshot on the second Map Algebra slide (illegible and badly dated; the spreadsheet analogy is kept in the speaker notes). ArcGIS screenshot that needs a QGIS re-shoot: images/ras-dem-3d-arcview.jpg on the "Surfaces derived from a DEM" slide, an ArcView 3D Analyst window; replace with a QGIS 3D map view or a slope/hillshade pair. Software wording updated for QGIS: ArcToolbox becomes the Processing Toolbox, CLIP becomes Clip raster by mask layer, and the Raster Calculator is named on the Raster menu. Slides added beyond the source: Today's Goals; "The four things that define a raster" (cells, resolution, extent, no-data); the discrete-or-continuous quiz; the work-one-cell map algebra quiz; the DEM and derived-surfaces section; "Where this goes in engineering"; the Thursday preview; and Before Next Class. The stray ModelBuilder workshop abstract in the source title slide's speaker notes was left over from a different deck and was not carried across.
Update 2026-09-02: ArcGIS-era screenshots replaced with QGIS 3.44 captures made by tools/qgis_reshoot_screens.py: ras-dem-derived-surfaces.jpg (hillshade + contours, slope) replaces the ArcView 3D screenshot.
Five minutes, in pairs, then a show of hands on the two worth arguing about: no-data against a real zero, and why adding and multiplying give different answers on the same two cells. If the room has no signal, put the URL on the board. The page is linked from the Week 6 page too.