Catalyst.earth Logo
Catalyst.earth Logo

DSM To DTM Conversion

A Digital Surface Model (DSM) is a variation of a Digital Elevation Model (DEM) that represents the surface of the earth, including vegetation, buildings and other man-made features. A Digital Terrain Model (DTM) only includes the elevation of the ‘bare earth’ with vegetation, buildings and other man-made features removed (though roads and bridges are typically retained).

In photogrammetry (for the production of ortho images) and GIS (e.g., for watershed analysis), a DTM is the preferred product. However, a DSM does have uses in true-ortho production and other specific types of analysis. A DEM is a generic term that could refer to either a DSM or DTM.

In CATALYST Professional software, there are two primary tools to convert a DSM to DTM. These are:

  • DEM Editing tool in Focus - provides a manual method of conversion
  • DSM2DTM algorithm - provides an automated capability

The purpose of this tutorial is to provide you with an easy-to-follow step-by-step guide for converting a Digital Surface Model (DSM) to a Digital Terrain Model (DTM).

Manual Editing: DEM Editing Tool In Focus

The manual method in Focus allows for very fine control of the conversion process and gives the best results.

  • Open the DSM in Focus: Focus > File > Open
  • Open the DEM Editing tool: Layer > DEM Editing...

The DEM Editing panel will appear. The DSM is shown in a shaded relief for easier viewing. When making edits, it is suggested that you draw a polygon over a portion of the working area of the DSM. You can use the following order of filters below to convert that section of the DSM to a DTM. These filters can then be repeated using another drawn polygon until the entire DSM is converted:

  • Terrain filters
  • Bump and Pit filters
  • Median filters
  • Clamp filters
  • Final manual touch-up
Terrain Filters

The first filter typically used is the Terrain Filter. This can be either “Terrain filter (flat)” or “Terrain filter (hilly)” depending on your data type. Terrain filter (flat) is more suited to flat areas such as fields or urban areas, while Terrain filter (hilly) is most suited to mountainous or hilly areas.

The two main parameters within the Terrain Filters are Size and Gradient.

Size defines the size of the filter and is measured in pixels. The default value is 100 for a filter size of 100 x 100 pixels, or the value specified previously. If you have your measurements in metres, you must convert them to pixels using the formula below:

\[Size (Pixels) = \frac{Size (Metres)}{Image Resolution (Metres)} \]

A higher Size value will remove more objects from the DSM. It's best to set the value to the size of the largest buildings in your scene.

Gradient defines the maximum slope that corresponds to a natural feature, such as a hill. The default value is 30, or the value specified previously. It's the cutoff range for objects to remain in the DTM as the operation attempts to preserve features with slopes below the specified threshold. It's measured in degrees, ranging from 0 to 90 (completely flat to completely vertical). When determining the value for the Gradient parameter, it is good to keep in mind that the natural angle of repose (the typical angle that natural ground settles at) is about 25 degrees. This means that dropping the gradient value below 25 degrees may begin to remove natural features such as hills. This is why it is ideal to set Gradient as high as possible, as it reduces the likelihood of removing natural slopes.

After running the initial Terrain Filter, you may run further Terrain Filters to improve the smoothness and remove any remaining buildings. This can dramatically improve your filtering quality and is highly recommended. It is important to reduce the Size of the filter when also reducing the Gradient because it can help prevent the removal of large, gently sloped features, as they will not fall within the Size threshold. If large, coarse filters are run consecutively, smaller hills are often removed.

Pit And Bump Filters

Pit and Bump filters smooth the DTM by removing small pits and bumps in the landscape while blending the edges of where buildings used to be. Ideally, these filters should be small in size with a low gradient to avoid removing important features. The parameters used in this filter are similar to the parameters of the terrain filters, with Size representing the largest object to remove and Gradient representing the highest slope of an object to remove.

5 filters can be used to remove bumps and pits

  • Remove Bumps (flat) & Remove Bumps (hilly) - This filter attempts to remove bumps from the landscape in the area under the mask.
  • Remove Bumps (keep linear) - this filter attempts to preserve long, thin shapes that Remove bumps (hilly) might otherwise remove.
  • Remove Pits (flat) - This filter attempts to fill in pits from the landscape in the area under the mask. It is optimized for flat terrain
  • Remove Pits (hilly) - This filter attempts to fill in pits from the landscape in the area under the mask. It is optimized for hilly terrain
Median Filters

The Median filter is part of the final smoothing of the DTM. This filter will not further remove any bumps, pits, or buildings, but will smooth the edges of hills and roads. This filter is best used as a final step.

There are two types of median filters, the Median filter and the Hybrid median filter. The Hybrid median filter preserves harsh edges in cases where the normal Median filter may blur them, so the relevancy of one or the other is dependent on the dataset. For most datasets, a filter size between 7 – 11 is suitable.

Clamp Filters

The final step in creating a DTM from a DSM is the Clamp filter. This filter stabilizes portions of the elevation model by raising and lowering pixels if they are within a certain threshold. This is excellent for levelling out large flat surfaces, like roads or fields. The suggested values for this filter are a Size of 10 and a Clamp percent of 10. Using both the Median and Clamp filters will greatly smooth out the DTM.

Manual Touch-Up Edits

There may be leftover buildings that need to be removed, or roads that need to be cleaned up along their edges. These manual edits can be completed within the DEM Editing Tool by drawing polygons around the problematic areas and applying filters.

The final filtered imagery can be seen below. The first image is the original DSM. The second image is the final filtered DTM.

Before:


After:

Automatic Editing: DSM2DTM Algorithm

It is possible to automatically convert a DSM to a DTM using the DSM2DTM algorithm. This algorithm can be accessed through the Focus Algorithm Librarian or by using the EASI or Python interfaces.

The automated method via the DSM2DTM algorithm can produce acceptable results under many circumstances, but the results usually benefit from touch-ups via manual editing in Focus. Automatically generated DTMs may not be as high quality as a manual approach, and it is highly recommended that a copy of the original DSM be created. It may be necessary to run the DSM2DTM algorithm a number of times with different settings to get a level of quality that is acceptable.

The DSM2DTM algorithm allows a sequence of Terrain, Pit, Bump, Median, and Clamp filters to be run on the DSM. This mimics the recommended sequence described in the manual editing technique in the steps above.

To access the DSM2DTM algorithm from Focus

  1. Select Focus on the CATALYST Professional toolbar
  2. Open the Algorithm Librarian - Tools > Algorithm Librarian
  3. Select Algorithm Library > All Algorithms > DSM2DTM. Alternatively, you can click the Find... button and search for the DSM2DTM algorithm
  4. The DSM2DTM Module Control Panel opens:
    • In the panel's Files tab, select the DSM you will be converting to a DTM
    • Select an output file name and location for the DTM
    • Click on the Input Params 1 tab
    • Set the parameters and filters based on the screenshot below. Note that you can set multiple filters in a single run.
  5. Click Run
  6. Once the algorithm has run, verify the results based on your dataset
  7. You can optionally run DSM2DTM gain with additional filters set

Note: The object size determines the size of the kernel that will be used to search for local minimum. Generally, a dimension that is large enough to remove most buildings and surface features is used. However, some manual editing is usually required to refine the final product.

The final filtered image can be seen below. If required, you can continue to run the DSM2DTM algorithm on the filter output to generate the desired result.

For more information on this algorithm and all of the parameters mentioned above, please see the CATALYST Professional Help Documentation.

Restoring Areas Of The DTM

In some cases, in an automated DSM to DTM conversion, some areas are removed that should have remained. For example, the tops of mountains and hills. This is caused by over-filtering the image. In a manual conversion, you may notice that an error occurred when it is too late to undo the action. In these cases, there is a need to restore the original DSM data in those areas. This can be accomplished using the Smart GeoFill tool in Focus.

To do this, the original DSM and the DTM are loaded into the Focus window. The Smart GeoFill tool is used to copy/paste data from the original DSM to the DTM, restoring the removed values. You can learn more about how to use this tool from the Smart GeoFill Tutorial.

envelopephone-handsetcross