Understanding the Landscape · Lesson 2 of 5
Slope and Aspect
~15 min
The Concept
A farmer near the basin's agricultural zone reports that one of his fields floods every time it rains hard, while an identical field fifty meters away stays dry. Same soil, same crop, same rainfall, so what's different? Your supervisor points at the DEM: 'Look at the slope, not just the elevation.'
Slope measures how steeply the ground rises or falls, not how high it is. Two locations can be at the same elevation but have completely different slopes, and water behaves very differently on each: it pools on flat ground and runs off quickly on steep ground.
Aspect (which compass direction a slope faces) matters because slopes facing the sun dry out faster, which affects everything from soil moisture to which plants grow where.
The Analogy
Think of a playground slide. Elevation is how tall the slide is. Slope is how steep the slide feels when you sit at the top. A tall slide can still be gentle, and a short slide can still be terrifyingly steep. Water, like a marble, cares about the steepness, not the height.
The Math (optional)
Slope is calculated from how much elevation changes over a short horizontal distance, in both the east-west and north-south directions.
Slope (percent)
The rise in elevation (Δz) divided by the horizontal distance traveled (Δx), expressed as a percentage, a 10% slope rises 10 meters over 100 meters of horizontal distance.
Code (optional)
import numpy as np
cell_size_m = 10 # each DEM cell covers 10m x 10m
dz_dx, dz_dy = np.gradient(dem, cell_size_m)
slope_percent = np.sqrt(dz_dx**2 + dz_dy**2) * 100
print("Steepest cell in the basin:", slope_percent.max(), "%")
print("Slope at the flooding field (row 210, col 88):", slope_percent[210, 88], "%")Line by line
- np.gradient computes how elevation changes cell-to-cell in both directions at once.
- Combining both directions with the Pythagorean-style formula gives the steepest direction of change at each cell.
- Multiplying by 100 converts the ratio into a percentage slope, matching the equation above.
Why Real Researchers Care
Slope maps drive real flood-risk and erosion models: the same np.gradient approach here is the basis of tools like ArcGIS's Slope function and QGIS's terrain analysis plugin. You're using a simplified version of the exact method professional hydrologists rely on.
Quick Check
Q1. Two fields have the same elevation. Can they still have different slopes?
Your Goal
Using the code pattern above, predict whether the flooding field or the dry field has a lower slope percentage, then explain why that alone could account for the farmer's observation.
Hint: Lower slope means water has less driving force to run off, so it tends to pool instead.
Teach It Back
Explain the difference between elevation and slope to someone standing on a hillside, pointing at things.