Starting from the Agisoft Metashape Professional 2.0.0 the DEM editing tools are available. The DEM editing applies to the surface, so it allows, for example, to edit the edges of roofs, or add surface in the areas with holes (water, forest and so on).

The main steps of working with DEM editing tools are described in this article.


To enter the edit DEM menu please draw a polygon or polyline in the area, that should be edited. On the animation below a polygon is created, that outlines the area with cars, that are to be removed from the DEM to level the road surface: 




To enable or disable Show Labels option for polygons/polylines on the Ortho view, select Ortho > Show/Hide Items > Show Labels. 




Fill DEM - applies only to polygons. 
Create Breakline can be applied to polygons and polylines.


The DEM editing tools are available from the context menu of the shape. Click right-button on the selected polygon to access the context menu and choose one of the available options: 



Fill DEM tools


In the Fill DEM dialog box the following filling methods are available: Constant, Best-fit plane, IDW interpolation and Natural Neighbour interpolation. Detailed information for each method is provided in the following sections of this article.


Constant filling method


In the example on the animation below the polygon outlining the cars is filled with the Constant filling method. The surface will be created according to the level set in the Fill elevation (m) field of the Fill DEM dialog. The value of the constant can be entered from the keyboard or selected on the DEM with the cursor (for the purpose use Pick button and click on the DEM outside the polygon): 



Exclude nested polygons option can be enabled if you want to fill the surface with one height, but exclude some area (like the square building on the example below). Before using the Fill DEM tool, you need to draw a polygon around the object that is to be excluded. Then enable Exclude nested polygons option in the Fill DEM dialog window: 




After Fill or Create Breaklines tolls are applied to a shape - the borders of the shape become dotted as illustrated below:



After the Fill DEM feature is applied, the contour of the shape can be edited: the filled area will change along with the border of the shape as illustrated below:




Best-fit plane filling method


In this method the best fit plane is calculated basing on the vertices of the drawn polygon. This method can be helpful when the object is not flat, for example when a sloped roof surface should be edited, as shown in the example below:




When Sample edges parameter is enabled the entire face and the edges will be taken into account when calculating the best fit plane.


In order for the vertices of the different planes of the roof to match, enable Vertex snap (please check our article - Snapping options for shape drawing). Please note that after enabling the Vertex snap tool you need to hold down Shift button while drawing a polygon. 




IDW interpolation method


IDW - Inverse distance weighting. An interpolation method that determines the value of pixels using a linearly weighted combination of a set of points or pixels. Weight is the inverse function of the distance from known points or pixels, raised to the power. In Metashape the power value by default is 2, it can be changed in the Fill DEM dialog window. If the power value is greater then 2, the points closer to the query location will have more influence and the resulting surface will be more detailed. Lesser value results in more homogeneous surface.








Natural Neighbour interpolation filling method


The Natural neighbor method of spatial interpolation is developed by Robin Sibson. This interpolation method finds the subset of input samples closest to the requested point and applies weights based on proportional regions to them to interpolate the value.




Create Breakline


When using the Create Breakline tool, the algorithm approximates with planes right and left neighborhoods of the polyline/polygon. This tool helps to correct the roof edges while saving time on manual tracing of the interior and exterior of the roof followed by filling the corresponding polygons with Constant filling method.




The results of building an Orthomosaic from DEM with breaklines and without are presented below:



To apply all the changes click Update button on the toolbar before building an orthomosaic



How to reset settings?


To undo the changes, select Edit DEM > Delete Patch command from the context menu of the shape:




The Delete Patch command only works before the changes are applied to the DEM. If the DEM was updated, then it will be impossible to cancel the application of patches to the DEM. To undo changes after the DEM was updated  it is necessary to re-build the DEM and start the editing again.



How to apply changes to DEM?


To apply all the changes either click Update button on the toolbar:


or select Tools > DEM > Update DEM: