Short answer
These three terms describe what surface the elevation values represent. A DSM (digital surface model) is the first reflective surface: tree canopy, rooftops, bridges, anything the sensor hits first. A DTM (digital terrain model) is the bare earth with vegetation and structures stripped out. DEM (digital elevation model) is the umbrella term, and in everyday use it usually means a bare-earth grid (effectively a DTM) — but the convention is inconsistent across providers, so you must read the metadata. The practical rule: bare earth (DTM/DEM) for slope, hydrology, and geomorphology; first surface (DSM) for viewsheds, line-of-sight, solar, and canopy or building height.
Defining the three precisely
- DSM — every cell holds the elevation of the topmost object. Over a forest it is the canopy top; over a city it is the rooftops. Derived from the first return of a LiDAR pulse, or from photogrammetric image matching (which sees the surface, not under it).
- DTM — every cell holds the bare-ground elevation. Produced by classifying LiDAR points into ground vs non-ground (e.g. progressive morphological or cloth-simulation filtering) and interpolating a surface from ground returns only. A DTM may also carry breaklines (ridges, stream centrelines) for a more faithful terrain.
- DEM — generic "elevation grid." USGS 3DEP products, SRTM, and Copernicus DEM are all called DEMs; SRTM at 30 m is effectively a DSM over forest and built-up areas because C-band radar did not penetrate canopy, whereas a LiDAR-derived 3DEP DEM is bare earth. Same word, different surface — hence: always check the metadata.
The relationship is simple arithmetic: over an object, DSM ≥ DTM, and the difference is the object's height.
Choosing the right model for the task
| Analysis | Use | Why |
|---|---|---|
| Slope, aspect, curvature | DTM | Derivatives must describe the ground, not roof pitch or canopy |
| Hydrology, flow accumulation, watersheds | DTM | Water runs on bare earth; buildings/canopy create false barriers |
| Geomorphology, landform mapping | DTM (often smoothed) | Bare-earth relief is the signal |
| Viewshed, line-of-sight, telecom | DSM | Trees and buildings block sightlines |
| Solar radiation, shadow modelling | DSM | Canopy and structures cast the shadows |
| Flight obstruction, drone planning | DSM | Obstacles are the whole point |
| Canopy height, biomass, building height | DSM − DTM (CHM/nDSM) | Height above ground is the measurement |
Running hydrology on a DSM is a classic error: buildings and tree clumps become artificial dams that divert modelled flow.
Worked example: canopy height model
To get a canopy height model (CHM), also called a normalized DSM, subtract bare earth from the surface. The non-negotiable prerequisite is that both rasters are co-registered: same CRS, same cell size, same extent/origin, same vertical units.
-
Align the grids. If the DSM and DTM differ, warp one to match the other exactly:
gdalwarp -t_srs EPSG:25832 -tr 1 1 -te 600000 5600000 601000 5601000 \ -r bilinear dsm.tif dsm_aligned.tif(
-tesets a common extent;-tra common 1 m cell.) -
Subtract with
gdal_calc.py, clamping spurious negatives to zero:gdal_calc.py -A dsm_aligned.tif -B dtm.tif --outfile=chm.tif \ --calc="(A-B)*(A>B)" --NoDataValue=-9999 --type=Float32 -
Sanity-check the result: canopy heights should be physically plausible (a few metres to a few tens of metres), with bare fields near zero. Large negatives or implausible spikes mean misalignment or a vertical-datum mismatch.
In QGIS the same is the Raster Calculator ("dsm@1" - "dtm@1"); in ArcGIS Pro it is the Minus tool or Raster Calculator.
Resolution: finer is not automatically better
Cell size sets the smallest feature you can represent and how derivatives behave:
- Terrain derivatives are neighbourhood operations. Slope at a cell is computed from a 3×3 window (Horn's method in GDAL
gdaldem slopeand ArcGIS Slope). On a 1 m DEM that window spans 3 m; on a 30 m DEM it spans 90 m. The same algorithm therefore reports different slope because it samples different scales. - A 1 m LiDAR DEM exposes tractor furrows, footpaths, and noise that are irrelevant to regional landform analysis and can dominate the slope histogram. For mapping drainage and landforms over a watershed, a 10-30 m DEM often gives a cleaner signal and runs far faster.
- Finer grids cost storage and compute non-linearly: halving cell size quadruples cell count.
The discipline is to match cell size to the feature scale you care about, and to resample deliberately (with documented method) rather than defaulting to the finest available product.
Units, NoData, and vertical datums
- Vertical units must match horizontal expectations: if elevation is in metres but the DEM is in a geographic CRS (degrees),
gdaldem slopewill produce nonsense unless you pass-s(scale) to convert, or better, reproject to a projected CRS first. - Slope units — degrees vs percent rise — are not interchangeable. Decide and label which one the output uses.
- Vertical datum — orthometric (NAVD88, EGM2008 geoid) vs ellipsoidal heights can differ by tens of metres. A CHM built from a DSM and DTM on different vertical datums is meaningless.
- NoData — voids, water masks, and edge fill must be set as NoData, not 0 or -9999 treated as real elevation, or they corrupt slope and hydrology at the boundary.
Common pitfalls and why they happen
- Assuming "DEM" means bare earth. SRTM and many global DEMs are surface-like over vegetation/buildings. Running hydrology on them inserts canopy "dams." The word does not tell you the surface — the metadata does.
- Computing a CHM from misaligned rasters. Different origins or cell sizes make the subtraction sample the wrong cells, producing salt-and-pepper height. Warp to a common grid first.
- Slope on a geographic-CRS DEM. Degrees of latitude/longitude are not metres, so a degree-based slope is wrong by a latitude-dependent factor. Reproject to UTM or State Plane first.
- Chasing maximum resolution. A 1 m grid amplifies micro-relief and noise; for landform-scale work it can be worse than a smoothed 10 m product.
QA and validation
- Confirm horizontal CRS, vertical datum, cell size, and NoData before any derivative.
- Spot-check elevations against known benchmarks or GNSS points.
- For a CHM, verify open ground sits near zero and canopy heights are physically plausible.
- Inspect edges, voids, striping (radar/photogrammetry artifacts), and pits before using slope or hydrology outputs.
- Record source product, resolution, vertical datum, slope units, and processing method with the layer.
Bathyl perspective
We choose the elevation surface from the question, not from whatever file is on hand: bare-earth (DTM/DEM) for slope, hydrology, and geomorphology; first-surface (DSM) for visibility, solar, and canopy or structure height. Derivatives ship with their resolution, vertical datum, and units stated, because a slope or watershed layer is only as trustworthy as the elevation model and processing assumptions behind it.
Related reading
- LiDAR-Derived DEMs for Terrain Work
- How Cell Size Changes Terrain Outputs
- Slope, Aspect, and Hillshade From DEM Data
- Terrain intelligence