Calculating canopy volume and height

  1. Generate a canopy/soil mask layer (also known as a threshold layer), described in the earlier tutorial on eliminating soil pixels.
  2. Drop the digital surface model (DSM) from your Pix4D outputs into your QGIS project.

  1. Using the raster calculator, input the following equation:


DSM_LAYER / THRESHOLD_LAYER


This will yield the DSM of just the canopies, without the soil. I name this the canopy digital surface model, “cDSM”.

  1. To determine the height of the soil in the same area, use the following equation:

DSM_LAYER / (THRESHOLD LAYER < 0.5)


I name this soil DSM “sDSM.”

  1. Check that the cDSM and sDSM files formed properly.

  1. Use the zonal statistics function (available by searching the Processing Toolbox; View → Panels → Processing Toolbox) to export maximum cDSM values (maximum canopy altitude), mean cDSM values (mean canopy altitude), and median sDSM values (median soil altitude).

  1. For Zonal Statistics’ “Output column prefix”, I usually give the raster file name, such as “cDSM_” or “sDSM_”, whichever I am working with, with the underscore afterwards.

  1. In the Layers Panel, right click on the new vector files, and click “Open Attribute Table”. Copy the results and paste into Excel, where you can continue data analysis, or read them into R.

  1. In R or Excel, subtract the mean cDSM values for each plot from the median sDSM, yielding average canopy height. Subtract maximum cDSM values from median sDSMs to identify maximum height per plot.

  1. To determine canopy volume, multiply the mean canopy height times the canopy area, (the “mean” of the classification layer multiplied by the area of the grid cell size), as described in the section on calculating canopy area. Now you have volumes!