What is a DEM?
A DEM (Digital Elevation Model) is a digital representation of the elevation of the Earth's surface. If you have looked at a 3D map of mountains, analyzed flood risk, calculated slope or created a terrain profile, a DEM was probably involved.
A DEM is a grid laid over the Earth's surface, with one elevation value in each cell. Together, those values describe the shape of the terrain. It is a raster, so each pixel stores an elevation value. The colors you see on a map are only a visualization of those values.
What you can derive from a DEM
A DEM can be used to derive:
- Slope and aspect
- Hillshade
- Contours
- Elevation profiles
- Watersheds
- Drainage networks
An example: flooding in a hilly region
Water flows from higher ground to lower ground. By analyzing a DEM you can identify high and low areas, flow direction, drainage paths, likely accumulation areas and watershed boundaries.
Where DEMs come from
DEM data can come from:
- Satellite missions
- Aircraft
- LiDAR
- Photogrammetry
- Drone surveys
The quality of a DEM depends heavily on how it was produced.
What is a DSM?
A DSM (Digital Surface Model) represents the elevation of the Earth's surface including the objects on it, such as buildings, trees and bridges.
In a city, the ground might be at 150 m while the roof of a nearby building is at 180 m. A DSM records the building's top at about 180 m. In a forest, a DSM captures the top of the trees, while a terrain model represents the ground underneath them.
DSM data can be generated from photogrammetry, LiDAR, stereo satellite imagery and drone imagery.
A practical example: rooftop solar
Assessing rooftop solar potential needs the roofs themselves, so a terrain-only model is not enough. A DSM represents building heights and surface structures, which you can combine with other information for a more detailed analysis.
DEM vs DSM vs DTM
DEM, DSM and DTM appear constantly in GIS, and software, datasets and organizations do not always use them in the same way.
| Term | Stands for | What it represents |
|---|---|---|
| DEM | Digital Elevation Model | Elevation data in general. Depending on the source, it can mean a bare-earth model or a broader elevation dataset. |
| DSM | Digital Surface Model | The elevation of the visible surface, including buildings, trees and infrastructure. |
| DTM | Digital Terrain Model | The bare-earth terrain, without above-ground objects. |
A simple example
Take a city where the ground is at 100 m, a building roof is at 125 m and the tree canopy is at 115 m.
| Model | Value |
|---|---|
| DTM | 100 m |
| DSM | 125 m at the building, 115 m at the canopy |
| DEM | Either, depending on the source |
Why the distinction matters
- For terrain slope, you want the ground surface.
- For building heights or urban 3D structure, a DSM is more useful.
- If you are processing drone imagery, you need to know whether your output represents terrain or visible surface.
Popular tools
You do not need all of these to start.
| Name | What it is | Good for |
|---|---|---|
| QGIS | Free, open-source desktop GIS | Viewing DEMs and deriving slope, aspect, hillshade and contours |
| GDAL | Open-source library and command-line tools for geospatial data | Terrain processing and format conversion from the command line |
| Google Earth Engine | Cloud platform with a large archive of satellite data | Working with elevation data over large areas without downloading it |
Glossary
| Term | Meaning |
|---|---|
| DEM | Digital Elevation Model, a grid of elevation values |
| DSM | Digital Surface Model, elevation including buildings and trees |
| DTM | Digital Terrain Model, bare-earth elevation |
| Slope | How steeply the ground rises or falls |
| Aspect | The direction a slope faces |
| Hillshade | A shaded relief view of terrain |
| Watershed | The area that drains to a common point |
| LiDAR | An active sensor using laser pulses to measure height and 3D structure |
| Photogrammetry | Measuring surfaces from overlapping photographs |
Test yourself
Try to answer each question before opening the answer.
1. What is a DEM, and how is it stored?
A DEM is a digital representation of the elevation of the Earth's surface. It is usually a raster where each pixel stores an elevation value.
2. Why can a DEM not tell you that an area will flood?
It only provides elevation. A flood analysis also needs other inputs, and the DEM is one component of that workflow.
3. A building roof is at 125 m and the ground is at 100 m. What do the DTM and DSM record there?
The DTM records 100 m (the ground) and the DSM records 125 m (the roof).
4. Why should you check the documentation of a dataset labelled "DEM"?
Providers use the term loosely. It may be a bare-earth model or a broader elevation dataset, so you need to check resolution, how it was generated and its vertical accuracy.
5. Name three things you can derive from a DEM.
For example slope, aspect, hillshade, contours, elevation profiles, watersheds or drainage networks.
6. Why is a terrain-only model not enough for rooftop solar assessment?
Rooftop solar needs the heights of the roofs themselves. A DSM represents building heights and surface structures, which a bare-earth model leaves out.
Quick quiz
Pick an answer for each question to see if you got it right.

