Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

NDVI in QGIS

A practical demonstration of calculating NDVI from Landsat imagery in QGIS

Normalised difference values are not included when you download multispectral imagery, but they are fairly easy to calculate yourself! We are now going to create an NDVI raster using our Landsat data as an example.

Calculating our NDVI raster

  • 1) Continue on with your Landsat project, or you can just add your landsat_composite file to a new map.
  • 2) On the Main Menu navigate to Raster > Raster Calculator. We are now going to put in the NDVI formula!
  • 3) In the Raster Calculator Expression Box type an opening bracket “(“.
  • 4) Double-click “landsat_composite@5” in the Raster Bands Box, this will be added to your expression.
  • 5) Add a minus and then double-click “landsat_composite@5” to add it to your expression.
  • 6) Add a closing bracket to create “(“landsat_composite@5” – “landsat_composite@4”)”
  • 7) Add a division sign “/”, and then redo the first part of the formula, but with a plus instead of a minus (this gives you the bottom line of the equation that we showed you earlier)

You should end up with “(“landsat_composite@5” – “landsat_composite@4”) / (“landsat_composite@5” + “landsat_composite@4”)”, hopefully this looks familiar!

  • 8) Click the browse button next to “Output layer”.
  • 9) Navigate to your Landsat folder and type “landsat_NDVI” and click the Save button.
  • 10) Then click the OK button!

raster calculator screenshot Writing the NDVI formula in the Raster Calculator.

It will take a little time to run, but then a new layer will be added to the QGIS Layers Panel and Map Window!

NDVI plot screenshot NDVI plot added to QGIS.

Changing the colours of our NDVI plot

You will notice that the plot is in black and white, with white areas being vegetation, grey being bare earth and black being water. These are the default colours, but we can change them if we want to. Let’s make them a bit more suitable!

  • 1) Right-click “landsat_NDVI” in your Layers Panel and select “Properties”.
  • 2) Click on the Symbology Tab.
  • 3) Change “Render type” from “Singleband gray” to “Singleband pseudocolor”.
  • 4) Click the small black arrow next to “Color ramp” and then navigate to “All color ramps” and select “RdYlGr”.
  • 5) Click the Classify button.
  • 6) Click OK.

Changing NDVI colours screenshot Changing the colours of our NDVI plot.

You should now have a more suitably coloured NDVI plot with green for vegetation.

Changing to blue screenshot The colours may still be improved, depending on your area, let’s change the lowest NDVI values to a blue colour to represent water.

  • 7) Right-click “landsat_NDVI” in your Layers Panel and select “Properties”.
  • 8) On the Symbology Tab double-click the deep red box.
  • 9) Use your mouse to select a blue colour that you think looks good and click OK.

Selecting a blue colour screenshot Click on a blue colour that looks good.

  • 10) Check you are happy with your colours and click OK.

Final NDVI palette screenshot We have changed red to blue.

Doesn’t that look better!

final NDVI plot screenshot Our finished NDVI plot.

Congratulations! We have reached the end of Week 3, and you have learned a lot about multispectral imagery along the way!

Let us know what you found most interesting this week in the comments!
This article is from the free online

Advanced Archaeological Remote Sensing: Site Prospection, Landscape Archaeology and Heritage Protection in the Middle East and North Africa

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now