Brief
An elevation map, or DEM (digital elevation model), is a grid of heights, often one every 30 m. It is a function of two variables. This project is about the slope of such a function, and you'll compute it for a real piece of land.
On a hillside the slope depends on which way you face. The partial derivative is the slope walking east, and the slope walking north. Together they form the gradient:
The gradient points straight uphill, and its length is the steepness in that direction. The slope in any other direction (a unit vector) is the dot product , called the directional derivative. Along a contour line the height doesn't change, so that dot product is zero. That's why the gradient always crosses contours at right angles.
Where the gradient is zero the ground is flat. That happens at peaks, at pits, and at passes, where a path between two peaks reaches its lowest point. Telling them apart from the heights around them is the last part of the build.
DATA · a public DEM tile
Objectives
Read-only. Log in to update progress.
VICTORY CONDITIONS
- Your gradient field matches `numpy.gradient` within 1e-6 at every cell, and your peak list equals the one from `scipy.ndimage.maximum_filter`. Record the max gradient difference with `python tools/mlarena.py record BM-14 "<max diff>"`.
- The README has a map of a real tile with contours, slope arrows, peaks and passes.
- One hiking route has a slope profile computed with the directional derivative.
Side quests
Terms in plain words
- Partial derivative
- The slope in one direction while the other coordinate is held still. ∂z/∂x is the slope walking east.
- Gradient
- The vector of partial derivatives (∂z/∂x, ∂z/∂y). It points straight uphill, and its length is how steep that is.
- Directional derivative
- The slope along any unit direction u. It equals the dot product ∇z · u.
- Contour line
- A line of equal height. The gradient always crosses it at a right angle.
- Saddle point (pass)
- A flat point that is neither a peak nor a pit: uphill in two directions, downhill in the other two.