2 - Generate NDVI#

Algorithm ID: hedgetools:generatendvi

This tool generates a vegetation raster using the Normalized Difference Vegetation Index (NDVI). It is computed from an infrared band and a red band.
The NDVI (Normalized Difference Vegetation Index) represents vegetation density and health, calculated from the red and infrared bands. Higher values indicate denser, healthier vegetation.

The binary mask or the sieved mask will be used to generate the tree cover layer in Generate Tree Cover.

The NDVI output can be used to generate additional binary masks with the Raster Calculator

Parameters#

Label

Name

Type

Description

Input Red raster

RED

[raster]

Red raster

Red band

RED_BAND

[raster band]
Default: 1

Band of the Red raster to use in case of multiband.

Input Infrared raster

INFRARED

[raster]

Infrared raster

Infrared band

INFRARED_BAND

[raster band]
Default: 1

Band of the Infrared 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.

NDVI value threshold (NDVI mask)
Optional

THRESHOLD_MASK

[numeric: double]
Default: 0.20

Threshold to create the binary NDVI mask. Pixels above this value are considered vegetation.

Compute sieved NDVI mask

SIEVE

[boolean]
Default: True

If enabled, the NDVI 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:

  • 0: Ignore – Only check input dimensions – raise error if dimensions differ.
  • 1: Fail – Check both CRS and dimensions – raise error if not equal.
  • 2: Union – Execute algorithm on the union of inputs.
  • 3: Intersect – Execute on intersection – raise error if no overlap.

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:

  • 0: None
  • 1: Nearest Neighbour
  • 2: Bilinear (2x2 Kernel)
  • 3: Cubic (4x4 Kernel)
  • 4: Cubic B-Spline (4x4 Kernel)
  • 5: Lanczos (6x6 Kernel)
  • 6: Average
  • 7: Mode
  • 8: Maximum
  • 9: Minimum
  • 10: Median
  • 11: First Quartile (Q1)
  • 12: Third Quartile (Q3)

Output NDVI

OUTPUT_NDVI

[raster]
Default: [Create temporary layer]

Output raster.

Output mask

OUTPUT_MASK

[raster]
Default: [Create temporary layer]

Output raster.

Output sieve

OUTPUT_SIEVE

[raster]
Default: [Create temporary layer]

Output raster.

Warning

The NDVI value threshold should be adjusted according to the acquisition date of your images. Typically, periods of lower vegetation activity require a lower threshold.

Warning

The output resolution of your mask should match the resolution used in Generate DHM. 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 NDVI

OUTPUT_NDVI

[raster]

NDVI raster representing vegetation.

Output mask

OUTPUT_MASK

[raster]

Binary mask where pixels above the threshold are set to 1.

Output sieve

OUTPUT_SIEVE

[raster]

Binary mask with small holes removed based on the sieve threshold.