# QGIS 3.16 different results in volume calculation

I am trying to find ways to calculate a volume with :

• 1 base DEM resolution 1m
• 1 elevation DEM resolution 1m

First method: Using the extension volume calculation tool as follows. The result seems correct 22484 m3.

Second method: I wanted to do the calculations by hand from a DEM representing the difference between elevation and base DEM. So in raster calculator :

then in theory, I have to multiply number_of_pixel by surface_of_pixel by sum_of_pixel_value

With zonal statistics algorithm, I have number of pixels and the sum of their values (?).

Here is the point : 56495 * 1 * 22503,27 = too many m3.
It seems obvious that I do something wrong in the second way but can't figure it out.

• What is wrong with the native raster surface volume or the SAGA tool raster volume? – Erik Oct 29 '20 at 11:20
• Sorry, I thought you were comparing 22484 m3 with 22503.27 – Luis Perez Oct 29 '20 at 12:28
• @Erik both do not allow a second DEM, only a base height. – Leehan Oct 29 '20 at 12:46

I think your result is 22503.27, I explain:

The subtraction of the DEM generates the depths, each one of them is a cube, of area the dimensions of the pixel and of height the depth.

The area is 1*1= 1m2

Therefore, the formula would be:

Sum(depth1 * area + depth2 * area +.....) Which would be the same as area*sum(depth1+depth2+...)

The wrong thing is to multiply by the total number of pixels, that sum is included in the sum of the depths. Your operation would be 1 * 22503,27= 22503,27

Slightly different, which may be due to the optimization option