Contour Maps: Reading Terrain from Lines

simulator intermediate ~10 min
Loading simulation...
20 contour lines at 50m intervals

With a maximum elevation of 1000m and a 50m contour interval, the map shows 20 contour lines. Closely spaced contours indicate steep slopes; widely spaced contours indicate gentle terrain.

Formula

Slope = arctan(delta_elevation / delta_horizontal_distance)
Gradient = contour_interval / map_distance_between_contours
Marching squares: threshold crossing at edge = lerp(v0, v1, (iso - v0)/(v1 - v0))

The Art of Representing the Third Dimension

Topographic maps face a fundamental challenge: representing three-dimensional terrain on a two-dimensional surface. Contour lines — invented in the 18th century — solve this elegantly by connecting points of equal elevation into continuous curves. A skilled map reader can look at contour patterns and mentally reconstruct mountains, valleys, ridgelines, and saddle points without any color or shading.

How Contour Lines Encode Slope

The spacing between contour lines directly encodes slope steepness. Closely packed contours mean steep terrain — the elevation changes rapidly over a short horizontal distance. Widely spaced contours indicate gentle slopes. A cliff appears as contour lines merging together. A plateau appears as a large area with few or no contours. This relationship between spacing and steepness is the fundamental grammar of topographic maps.

Algorithmic Contour Generation

Modern contour maps are generated algorithmically from digital elevation models (DEMs). The marching squares algorithm processes the elevation grid cell by cell, identifying where each contour level crosses cell edges through linear interpolation. The crossing points are connected into polylines that form the smooth contour curves you see on the map. This simulation implements this algorithm in real time.

Reading Terrain Features

Contour patterns form a visual vocabulary for terrain. Concentric closed loops indicate peaks or depressions. V-shapes pointing upstream mark valleys; pointing downstream mark ridgelines. Saddle points appear where contours from two peaks almost touch. Hachure marks on closed contours distinguish hilltops from depressions. Mastering this vocabulary lets you navigate terrain from a paper map alone.

FAQ

How do contour lines represent elevation?

Each contour line connects points of equal elevation. The vertical distance between adjacent contours (the contour interval) is constant. Where contour lines are closely spaced, the terrain is steep. Where they are far apart, the terrain is gentle. Closed loops indicate hilltops or depressions, and V-shapes pointing uphill indicate valleys.

What is a contour interval and how is it chosen?

The contour interval is the elevation difference between adjacent contour lines. It is chosen based on terrain relief and map scale. Mountainous terrain might use 50-100m intervals, while flat coastal areas might use 1-5m intervals. The goal is readable spacing — neither too crowded nor too sparse.

How are contour lines generated from elevation data?

The marching squares algorithm is the standard method. The terrain is sampled on a grid, and for each grid cell, the algorithm determines which edges the contour line crosses based on corner elevation values. The crossing points are interpolated and connected to form smooth contour curves.

What terrain features can you identify from contour patterns?

Concentric closed loops indicate peaks (decreasing outward) or depressions (increasing outward, marked with hachures). V-shapes pointing uphill are valleys; pointing downhill are ridges. Figure-eight patterns indicate saddle points. Evenly spaced parallel contours indicate a uniform slope.

Sources

Embed

<iframe src="https://homo-deus.com/lab/cartography/contour-mapping/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub