Skip to content
Terrainly Open viewer

Guide · 6 min read

What is a DEM? Digital elevation models explained

A DEM is a map of height. Instead of showing roads or borders, every cell in a grid stores how high the ground is at that spot. Here’s what that means in practice, and the jargon you’ll meet along the way.

The basics

A Digital Elevation Model (DEM) is a raster: a grid of equally sized square cells (pixels). Each cell holds one number, the elevation of the ground there. Because the grid is tied to real-world coordinates, a DEM can be laid exactly over a map.

You can think of it as a photograph where the “colour” of each pixel is a height in metres (or feet) instead of a shade. The cell size, called the resolution, tells you how much ground one cell covers: 1 m for a detailed lidar survey, 30 m for most global datasets.

DEM vs DSM vs DTM

People use “DEM” in two ways. Sometimes it means any elevation grid; sometimes it means only the bare ground. The more precise terms are:

TermWhat it measuresIncludes trees and buildings?
DSM (Digital Surface Model)The top of whatever the sensor sees first: rooftops, tree canopy, the ground where it’s bareYes
DTM (Digital Terrain Model)The bare earth, with vegetation and structures removedNo
DEMUmbrella term. Often used for bare-earth models, but check the product descriptionDepends

The difference matters. A forest shows up as a bumpy 20-metre-high carpet in a DSM and disappears in a DTM. For flood modelling or slope analysis you usually want a DTM. For line-of-sight or urban studies a DSM is often better. Some datasets come in both flavours, for example Canada’s HRDEM. Others, like the Copernicus global DEM, are surface models.

How elevation data is made

  • Lidar. An aircraft or drone fires laser pulses and times the echoes. Some pulses reach the ground between leaves, so lidar can produce both a surface and a bare-earth model. It gives the most detailed results, often 1 m or finer.
  • Photogrammetry. Overlapping photos from a drone or aircraft are matched to compute 3D shape. It produces a surface model (it can’t see through trees) and is the usual source for construction and mining surveys.
  • Radar from space. Satellites measure ground height from orbit. NASA’s Shuttle mission (SRTM) mapped most land between about 60°N and 56°S in 2000, and the Copernicus DEM is built from the TanDEM-X radar satellites. These are typically 30 m grids with global coverage.
  • Older maps. Many national models were interpolated from contour lines on topographic maps. They’re coarser and can show terracing artifacts.

Resolution and accuracy

Resolution is the cell size. Smaller cells show finer detail but make bigger files: halving the cell size quadruples the number of cells.

Accuracy is a different thing: how close the stored heights are to the truth. A 1 m grid can still be off by half a metre vertically, and a coarse 30 m grid can be quite accurate on open ground. Don’t assume that small cells mean exact heights. Check the dataset’s documentation for vertical accuracy.

Coordinate systems and vertical datums

Two separate questions describe where a height is:

  • Horizontal coordinate system (CRS). How the grid is laid out on the globe: latitude/longitude, UTM, a national grid and so on. This is what lets the viewer drop your file at the right place on the map. See our guide to common loading problems if yours isn’t recognized.
  • Vertical datum. What “zero height” means. Heights can be measured from an ellipsoid (a smooth mathematical Earth) or from a geoid, a model of mean sea level. These can differ by tens of metres in places, so don’t mix DEMs with different vertical datums without converting.

Also check the units. Most DEMs use metres; some US datasets use feet. The viewer converts feet to metres when the file says so (or when it uses a feet-based coordinate system).

File formats

  • GeoTIFF (.tif): by far the most common. Location is stored inside the file. A Cloud-Optimized GeoTIFF is a GeoTIFF arranged so software can fetch just a window of a huge file over the internet.
  • Esri ASCII grid (.asc): plain text, simple but bulky.
  • SRTM HGT (.hgt): raw 16-bit tiles used for the SRTM dataset.
  • Erdas Imagine (.img) and NetCDF (.nc): seen in some government and scientific datasets.

The viewer reads GeoTIFF. The others can be converted in one command with GDAL (gdal_translate input output.tif) or in QGIS.

What is a hillshade?

A raw DEM looks like a flat colour map. A hillshade adds realism by simulating a light source (by tradition in the north-west, 315°, at 45° above the horizon) and computing how brightly each slope would be lit. Slopes facing the “sun” are bright, the others are dark, and the terrain suddenly pops in 3D. It doesn’t change the data; it’s only a way of seeing it. Try different sun directions in the viewer: features running parallel to the light disappear, so rotating the sun reveals them.

What DEMs are used for

  • Hydrology and flood mapping: where water flows and what it floods.
  • Slope and aspect analysis: landslide risk, farming, trail design, solar potential.
  • Engineering and construction: site grading and earthwork planning.
  • Visibility analysis: what can be seen from a tower, a road or a viewpoint.
  • Cartography and visualization: shaded-relief maps, 3D renderings and contour lines.
  • Science: geology, glaciology, ecology and change detection between surveys.

Want to see one? The viewer’s sample is a real 1 m lidar DEM of the Eardley Escarpment in Gatineau Park. Open the viewer and press “Try real lidar terrain”.

Look at your own DEM

Free, private, and nothing to install.

Open the viewer →