Rasterflow, Earth Intelligence & inference engine now in public preview Learn More

What is a Digital Elevation Model? DEM, DTM, DSM

What is a digital elevation model?

A digital elevation model (DEM) is a raster in which every cell holds the height of the ground at that location, on a regular grid with a known cell size and vertical datum. A digital terrain model (DTM) records bare earth; a digital surface model (DSM) includes buildings and trees. DEMs underpin flood, slope, and visibility analysis.

What a digital elevation model is

A digital elevation model is terrain as a grid. Each pixel stores one number, the elevation in meters above a reference surface, on a georeferenced grid.

The defining property is the vertical datum. Heights are relative to a geoid such as EGM2008 or to an ellipsoid such as WGS84, and the two differ by up to 100 m, so mixing datums produces errors larger than most terrain features.

Three terms are often confused. DEM is the general category, and DTM is a DEM of bare ground with vegetation and structures removed. DSM is a DEM of the first surface the sensor met, including canopy and rooftops.

Sources vary by resolution and coverage. The Copernicus GLO-30 DEM covers the globe at 30 m from TanDEM-X radar, and SRTM covers 60°N to 56°S at 30 m from a 2000 shuttle mission. The USGS 3DEP program delivers 1 m DEMs from lidar across the United States.

National mapping agencies publish finer models, such as the Netherlands’ AHN at 0.5 m.

What a digital elevation model does

A digital elevation model answers every question that depends on height, slope, or what is downhill from where.

Flood modelers route water across a DEM to produce depth grids; the model’s accuracy sets the flood map’s accuracy.

Engineers and developers screen sites by slope, cut-and-fill volume, and drainage before buying land, and telecom planners compute line of sight from a tower to every rooftop with a DSM.

Solar developers compute aspect and shading to estimate irradiance per parcel.

Insurers derive elevation relative to the nearest stream and coast as a flood vulnerability field.

Foresters subtract a DTM from a DSM to get canopy height, then estimate biomass.

Each derivative is a neighborhood calculation on the same grid, which is why DEM work is raster work.

How a digital elevation model works

A DEM is produced by measuring heights and interpolating them onto a grid. Radar interferometry (SRTM, TanDEM-X), lidar, stereo photogrammetry, and ground survey each supply the raw heights.

DatasetSourceResolutionCoverageVertical accuracy
Copernicus GLO-30TanDEM-X radar, 2011 to 201530 mGlobalAbout 4 m
SRTMShuttle radar, 200030 m60°N to 56°SAbout 9 m
USGS 3DEPAirborne lidar1 mUnited States10 cm on open ground
ASTER GDEMStereo optical30 m83°N to 83°SAbout 17 m

Cell size and accuracy are separate. A 30 m radar DEM smooths a levee out of existence; a 1 m lidar DEM shows the levee and its crest height.

Derivatives are computed from each cell’s neighbors. Slope is the maximum rate of elevation change across the 3 by 3 window, aspect is its compass direction, and hillshade simulates illumination for display.

Hydrologic conditioning fills spurious pits and enforces drainage so that flow direction and watershed delineation behave.

Distribution is as GeoTIFF tiles, often Cloud Optimized, in 1 by 1 degree cells for global products, with a companion mask or error layer.

The output of a DEM analysis is either another raster, such as slope, or a value per polygon, such as mean elevation per parcel.

Digital elevation model in Wherobots

WherobotsDB queries a digital elevation model in SQL and joins the result to parcels, buildings, and assets in the same statement.

The Copernicus GLO-30 DEM is available in Wherobots Cloud as a ready table, so a global elevation lookup starts from a query. RS_Value returns the elevation at a point, and RS_ZonalStats returns the mean, minimum, or maximum inside any polygon.

Finer DEMs load as out-db rasters with RS_FromPath. A 1 m 3DEP tile in S3 is read only in the pixels a query touches, with nothing downloaded first.

RS_MapAlgebra across two rasters subtracts a terrain model from a surface model to produce a height model. RS_Clip cuts a DEM to a boundary, and RS_Resamplechanges cell size to match another layer before comparison.

Relative elevation is a join. A property’s height above the nearest stream is RS_Value at the property minus RS_Value at the closest point on the stream network, found with a nearest-neighbor join.

Because raster and vector data share one engine, the elevation profile of a proposed transmission line, the slope of every parcel in a county, and the flood-relative height of every policy are each a single query.

The Wherobots MCP Server exposes the same functions to Claude Code and other agents, so an analyst can ask for parcels under 5 percent slope in plain language.

-- Mean and range of elevation per parcel from the Copernicus GLO-30 DEM
SELECT p.apn,
       RS_ZonalStats(d.rast, p.geometry, 1, 'mean') AS mean_elev_m,
       RS_ZonalStats(d.rast, p.geometry, 1, 'max')
         - RS_ZonalStats(d.rast, p.geometry, 1, 'min') AS relief_m
FROM parcels p
JOIN wherobots.copernicus_dem.glo_30m d   -- confirm table name in Data Hub
  ON RS_Intersects(d.rast, p.geometry);

Read more from Wherobots

Query elevation per parcel from the Copernicus DEM in WherobotsDB at cloud.wherobots.com.

Frequently asked questions

What is the difference between a DEM, DTM, and DSM?

A digital elevation model (DEM) is the general term for a raster of heights. A digital terrain model (DTM) is a DEM of bare ground, with buildings and vegetation removed, while a digital surface model (DSM) is a DEM of the first surface encountered from above, including rooftops and tree canopy. DSM minus DTM gives object height.

What resolution is a digital elevation model?

Digital elevation model resolution ranges from 1 m or finer for lidar-derived national products such as USGS 3DEP, to 30 m for global radar products such as Copernicus GLO-30 and SRTM, to 90 m for older global models. Resolution is the cell size; vertical accuracy is a separate figure, from centimeters to tens of meters.

Where can I download a free digital elevation model?

Free digital elevation models include Copernicus GLO-30 (global, 30 m) from ESA and on AWS Open Data, SRTM (30 m) from USGS EarthExplorer, and USGS 3DEP 1 m lidar DEMs for the United States from The National Map. OpenTopography and national mapping agencies such as the UK Environment Agency publish additional lidar-derived models.

What is a digital elevation model used for?

A digital elevation model is used for flood modeling, slope and drainage analysis in site selection, line-of-sight and viewshed studies for telecom, solar irradiance and shading estimates, watershed delineation, canopy height and biomass estimation when paired with a surface model, and as terrain correction input for satellite imagery and radar.