Normalized difference index
The code below uses the Toolbox SDK, which you can install with pip install toolbox-sdk.
Additional Python examples: using SDK, using Requests. If you prefer other programming language or need full API reference, check out Toolbox OpenAPI as well.
Docs
The tool calculates the normalized difference index for any two input images.
Inputs:
GDAL-supported rasters (the first band will be used for the calculations).
First raster. First measurement for the NDVI calculation, e.g. NIR band;
Second raster. Second measurement for the NDI calculation, e.g. red band.
Outputs:
A raster with normalized difference index in GeoTiff format.
The calculation is carried out according to the formula: (First image - Second image) / (First image + Second image). The pixel values of the resulting raster are in the range from -1 to 1 Before the calculation, both images are brought into a single spatial domain. The projection and spatial resolution of the first raster is used.
Examples of common normalized difference indices:
NDVI - for vegetation assessment (the first raster - NIR, the second - RED) For Landsat 8 data: 5 and 4 bands. For Sentinel: 4 - RED, 8 - NIR.
NDWI - for the detection of water bodies (the first raster - NIR, the second - SWIR). For Landsat 8 data: 5 and 6 bands. For Sentinel: 4 - RED, 11 (SWIR, 1610nm) and 12 (SWIR, 2190nm).
NDSI - for assessing the snow cover (the first raster - GREEN, the second - SWIR). For Landsat 8 data: 3 and 6 bands. For Sentinel: 3 - GREEN, 11 (SWIR, 1610nm) and 12 (SWIR, 2190nm).
Example:
Example input¶
Example output¶
Try the tool in action
Click on the Demo button above the tool form. The fields are filled in with demo values.
Click on the Run button.