Agisoft Metashape offers a complete set of tools to generate Digital Elevation Models (DEMs) and extract contour lines from drone imagery or terrestrial photogrammetry. These outputs are essential for topographic mapping, land surveys, construction planning, and environmental monitoring. In this tutorial, we’ll walk through the full workflow to create custom DEMs and contours in Metashape, including export options and best practices.
1. What is a DEM in Metashape?
A Digital Elevation Model (DEM) is a raster representation of the terrain’s elevation. In Metashape, it’s generated from the Dense Cloud or 3D Model and represents either a DSM (Digital Surface Model) or a DTM (Digital Terrain Model) depending on filtering.
- DSM: Includes buildings, vegetation, and structures
- DTM: Represents bare earth, with structures removed
2. Processing Workflow: From Photos to DEM
Start with a typical Metashape photogrammetry workflow:
- Import and align photos
- Build Dense Cloud with medium or high quality
- Classify ground points (optional for DTM)
- Build DEM from Dense Cloud
You can also generate a DEM from the Mesh, but Dense Cloud usually yields better elevation accuracy.
3. Classify Ground Points (for DTM)
To remove trees and buildings from the elevation model:
- Select the Dense Cloud
- Go to Tools → Dense Cloud → Classify Ground Points
- Choose parameters based on terrain type (flat, steep, forested)
Once ground points are classified, uncheck all other classes in the Dense Cloud view before building the DEM. This will ensure a true DTM is generated.
4. Building the DEM
Follow these steps to create the DEM:
- Select Workflow → Build DEM
- Choose Source data: Dense Cloud (recommended)
- Coordinate system: match your project’s CRS (e.g., WGS84 UTM zone)
- Set interpolation: Enabled or Extrapolated (to fill gaps)
The result will be a high-resolution raster elevation layer added to your Metashape chunk.
5. How to Generate Contour Lines
Once the DEM is built, you can generate contour lines (iso-lines) directly from it. These are vector lines connecting points of equal elevation, useful for maps and terrain analysis.
- Go to Tools → Build Contours
- Select the DEM as the source
- Choose contour interval (e.g., 0.5 m, 1 m, 5 m depending on terrain scale)
- Set smoothing level if needed (reduces jagged lines)
Metashape will add a contour layer to your project, which you can style or export.
6. Exporting DEM and Contour Lines
To use your elevation data in GIS or CAD software, export as follows:
- DEM: File → Export → Export DEM → GeoTIFF, IMG, or XYZ
- Contours: File → Export → Export Shapes → DXF, SHP, or KML
Be sure to include coordinate system metadata during export. For web use, convert to Tiled TIFF or publish via Cesium using Cesium ion.
7. Tips for Better Topographic Results
- Use Ground Control Points (GCPs) for improved elevation accuracy
- Fly higher for large terrain models; lower altitude for high-relief detail
- Choose cloudy days or late afternoon to reduce harsh shadows in imagery
- Use “Medium” or “High” Dense Cloud quality for DEMs—Ultra High is rarely needed
8. Common Use Cases
- Surveying: Property boundaries, volume calculations, slope maps
- Forestry: Terrain modeling beneath canopy
- Construction: Site planning, cut/fill analysis
- Archaeology: Revealing buried features through micro-topography
Conclusion
Creating custom DEMs and contour lines in Metashape is a powerful way to visualize and analyze terrain. Whether you’re producing survey maps or preparing elevation data for CAD or GIS, Metashape gives you full control over the quality and resolution of your topographic outputs. With the right settings and ground classification, your models will be both accurate and visually rich.