# 3 - Generate tree cover ```{container} algorithm-id **Algorithm ID**: `hedgetools:generatetreecover` ``` This tool generates a tree cover raster and vector layer using the DHM mask and NDVI mask obtained from [Generate DHM](./generate_dhm.md) and [Generate NDVI](./generate_ndvi.md), respectively. It intersects both masks, retaining only vegetation above the height threshold used to create the DHM mask. The vector layer is generated from the sieved raster if a sieve operation is performed. ## Parameters | Label | Name | Type | Description | |-------|------|------|-------------| | Input DHM mask | `DHM` | [raster] | Binary DHM mask raster. | | DHM band | `DHM_BAND` | [raster band]
Default: 1 | Band of the binary DHM raster to use in case of multiband. | | Input NDVI mask | `NDVI` | [raster] | Binary NDVI mask raster. | | NDVI band | `NDVI_BAND` | [raster band]
Default: 1 | Band of the binary NDVI raster to use in case of multiband. | | Extent of the study area
Optional | `EXTENT` | [extent] | Input extent from a layer, canvas, or other source to clip the rasters. | | Compute sieved tree cover mask | `SIEVE` | [boolean]
Default: True | If enabled, the tree cover mask is sieved to remove small holes. Recommended to reduce noise in vegetation layers. | | Threshold sieve value (pixel number) | `THRESHOLD_SIEVE` | [numeric: integer]
Default: 100 | Minimum number of pixels for a feature to be kept in the sieved mask. | | 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]
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 tree cover raster | `OUTPUT_TREE_COVER` | [raster]
Default: `[Create temporary layer]`| Output raster. | | Output sieve tree cover raster | `OUTPUT_SIEVE` | [raster]
Default: `[Create temporary layer]` | Output raster. | | Output vector tree cover | `OUTPUT_VECTOR`| [vector: polygon]
Default: `[Create temporary layer]`| Polygon vector layer. | ## Outputs | Label | Name | Type | Description | |-------|------|------|-------------| | Output tree cover raster | `OUTPUT_TREE_COVER` | [raster] | Tree cover raster. Intersection of the DHM and NDVI masks. | | Output sieve tree cover raster | `OUTPUT_SIEVE` | [raster] | Tree cover raster with small holes removed based on the sieve threshold. | | Output vector tree cover | `OUTPUT_VECTOR` | [vector: polygon] | Vectorized tree cover used in subsequent algorithms. |