# 1 - Generate DHM ```{container} algorithm-id **Algorithm ID**: `hedgetools:generatedhm` ``` This tool generates a Digital Height Model (DHM) from a Digital Terrain Model (DTM) and a Digital Surface Model (DSM). The Digital Height Model (DHM) represents the height of objects above the ground surface, such as trees or buildings. The binary mask will be used to generate the tree cover layer in [Generate Tree Cover](./generate_tc.md). The DHM output can be used to generate additional binary masks with the [Raster Calculator](https://docs.qgis.org/3.40/en/docs/user_manual/processing_algs/gdal/rastermiscellaneous.html#raster-calculator) or within HedgeTools metrics, such as [Strata Proportion](../physiognomy/strata_proportion.md). ## Parameters | Label | Name | Type | Description | |-------|------|------|-------------| | Input DTM | `DTM` | [raster] | Digital Terrain Model describing the ground elevation including obstacles (trees, buildings, etc.) | | DTM elevation band | `DTM_BAND` | [raster band]
Default: 1 | Elevation band of the DTM raster in case of multiband | | Input DSM | `DSM` | [raster] | Digital Surface Model describing the ground elevation without obstacles | | DSM elevation band | `DSM_BAND` | [raster band]
Default: 1 | Elevation band of the DSM raster in case of multiband | | Extent of the study area
Optional | `EXTENT` | [extent]
Optional | Input extent from a layer, canvas, or other source to clip the rasters | | Height value threshold (DHM mask)
Optional | `THRESHOLD_MASK` | [numeric: double]
Optional
Default: 2.50 | Height threshold for the binary mask of DHM, used to generate tree cover | | Handling of extent differences | `EXTENT_OPT` | [enumeration]
Default: 0 | Determines how the tool handles differing DSM and DTM extents: | | Output resolution (meters)
Optional | `RESOLUTION` | [numeric: double]
Optional
Default: `[same as input]` | Change the output raster resolution to the desired value. | | Resampling method
Optional | `RESAMPLING` | [enumeration]
Optional
Default: 0 | Resampling method for output resolution: | | Output DHM | `OUTPUT_DHM` | [raster]
Default: `[Create temporary layer]` | Output raster. | | Output mask | `OUTPUT_MASK` | [raster]
Default: `[Create temporary layer]` | Output raster. | ```{admonition} Warning :class: warning A lower **height value threshold** can introduce significant noise from tall crops, such as maize or sunflower, and may cause errors when creating the [topological polygon](../data_preparation/topological_polygon.md). However, it can also help retain hedges with mainly bushes. ``` ```{admonition} Warning :class: warning The output resolution of your mask should match the resolution used in [Generate NDVI](./generate_ndvi.md). You can set this using the **Output Resolution** parameter. Typical resampling methods are **Average** for downsampling and **Nearest Neighbour** for upsampling. ``` ## Outputs | Label | Name | Type | Description | |---------------|---------------|----------------|-------------| | Output DHM | `OUTPUT_DHM` | [raster] | Digital Height Model representing the height of objects above ground. | | Output mask | `OUTPUT_MASK` | [raster] | Binary DHM mask where values above the threshold are set to 1. |