Calculating Spectral_Indices
Note: For this tutorial you will need satellite data. The bands you need depend on the spectral index that you want to calculate and on the kind of data you are using. As an example, we will calculate the Normalized Difference Vegetation Index (NDVI), which requires the red band and the near-infrared (NIR) band. For Landsat 8 and 9, this corresponds to bands 4 and 5.
Contents
Load bands into QGIS[edit]
First, open a new QGIS project and add your bands. To do so, go to Layer → Add Layer → Add Raster Layer. Then choose the bands you need from where you saved them on your computer and click Add.
Raster calculator[edit]
Once the bands you need have been added to the Layers Panel, open the raster calculator. You find it under Raster → Raster Calculator.
Now, we need to enter the formula to calculate the NDVI: (NIR - Red) / (NIR + Red). You will see the bands that you added under Raster Bands. Make sure you know which band is the NIR band and which one is the red band. For Landsat 8 and 9 images, band 4 corresponds to the red band and band 5 corresponds to the NRI band. Then, enter the formula as above in the Raster Calculator Expression field. You can use the Operators provided in the field above by clicking on them, or use your keyboard. You can add a band to the formula by double-clicking on it in the Raster Bands field. Finally, specify where you want to save the new layer under Result Layer. Then click OK.
Adjust layer symbology[edit]
The new NDVI layer will appear in greyscale, which is not very nice for visual interpretation. You can adjust the colours under Layer Properties → Symbology. Double-click on the new layer in the Layers Panel to open the Layer Properties. Change the Render type to singleband pseudocolor and choose a Color ramp. Then click OK.
Interpret the results[edit]
The NDVI can range from -1 to 1, with high values indicating dense, healthy vegetation, and low values indicating areas without vegetation, such as bare earth or urban structures. Very low values often correspond to water. In this example, low NDVI values appear bright red, and high values appear dark green. The NDVI can for example be used to track deforestation.
The author of this entry is Neha Chauhan.


