I believe you can use some map algebra (raster > raster calculator) before you can preform your volume measurements in grass.
Assuming that your bathymetric data use positive values to represent the sea depth, and using your example for the range as 50 the min_depth and 200 the max_depth. For each of the raster cells you need to "remove" anything below the 200 and above the 50. You have 3 possible situations:
your cell depth is higher than the max_depth
(@bathymetry > 200)
your cell depth in the min_depth - max_depth range
(@bathymetry <= 200) * (@bathymetry >= 50)
your cell depth is lower that your min_depth
(@bathymetry < 50)
In case 1 the size of the water column will be the entire size of our range:
(@bathymetry > 200.0) * (200.0 - 50.0)
In case 2 the "water column" is from your bathimetry depth until the minimum value of the range:
(@bathymetry <= 200.0) * (@bathymetry > 50.0)*(@bathymetry - 50.0)
In case 3 there is no useful "water column" for your specie therefore it would be:
(@bathymetry <= 50)*0.0
Since the 3 cases never occurs at the same time, all we need is to sum the expressions:
(@bathymetry > 200.0) * (200.0 - 50.0) + (@bathymetry <= 200.0) * (@bathymetry > 50.0)*(@bathymetry - 50.0) + (@bathymetry <= 50)*0.0
Since the last expression is always zero, the is no point in including it:
(@bathymetry > 200.0) * (200.0 - 50.0) + (@bathymetry <= 200.0) * (@bathymetry > 50.0)*(@bathymetry - 50.0)
And the generic version of the expression would be:
(@bathymetry > max_depth) * (max_depth - min_depth) + (@bathymetry <= max_depth) * (@bathymetry > min_depth)*(@bathymetry - min_depth)
After this, you can use the output raster in r.volume to sum all "water columns" values
Using QGIS 2.18.3, it seems to work fine.
I set the "County Only Above Base Level", with base level equals to 0 and I get this log:
Algorithm Raster volume starting...
grid_calculus "Grid Volume" -GRID "C:\Users\xxxxx\AppData\Local\Temp\processingdd38dbc0f5ec434f922835f11ed2d9d0\3ddfa5d81c1744819d54de14d3c7a8f1\DTMdiscarica.sgrd" -METHOD 0 -LEVEL 0
C:\OSGeo4W\bin>set SAGA=C:/OSGeo4W/apps\saga
C:\OSGeo4W\bin>set SAGA_MLB=C:/OSGeo4W/apps\saga\modules
C:\OSGeo4W\bin>PATH=C:\OSGeo4W\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win32.egg\shapely\DLLs;C:\OSGeo4W\apps\Python27\DLLs;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\bin;C:\Windows\system32;C:\Windows;C:\Windows\WBem;C:\OSGeo4W\apps\msys\bin;C:\OSGeo4W\apps\Python27\Scripts;C:/OSGeo4W/apps\saga;C:/OSGeo4W/apps\saga\modules
C:\OSGeo4W\bin>saga_cmd grid_calculus "Grid Volume" -GRID "C:\Users\xxxxx\AppData\Local\Temp\processingdd38dbc0f5ec434f922835f11ed2d9d0\3ddfa5d81c1744819d54de14d3c7a8f1\DTMdiscarica.sgrd" -METHOD 0 -LEVEL 0
ERROR 1: Can't load requested DLL: C:\OSGeo4W\apps\saga\dll\gdal_MrSID.dll
127: Impossibile trovare la procedura specificata.
ERROR 1: Can't load requested DLL: C:\OSGeo4W\apps\saga\dll\gdal_MrSID.dll
127: Impossibile trovare la procedura specificata.
_____________________________________________
##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
_____________________________________________
_____________________________________________
library path: C:\OSGeo4W\apps\saga\modules\grid_calculus.dll
library name: Grid - Calculus
tool name : Grid Volume
author : (c) 2005 by O.Conrad
_____________________________________________
Load grid: C:\Users\xxxxx\AppData\Local\Temp\processingdd38dbc0f5ec434f922835f11ed2d9d0\3ddfa5d81c1744819d54de14d3c7a8f1\DTMdiscarica.sgrd...
Parameters
Grid system: 1; 1290x 1792y; 624079.089172x 4919509.290207y
Grid: DTMdiscarica
Method: Count Only Above Base Level
Base Level: 0.000000
Grid Volume: Volume: 890177920.097229
C:\OSGeo4W\bin>exit
Converting outputs
Loading resulting layers
Algorithm Raster volume finished
So, I get Volume: 890177920.097229
(I think it's expressed in the project units).
EDIT Before running the algorithm, remember to check this option from Processing
> Options
:
Otherwise, you won't see any result.
Best Answer
SAGA Raster volume with
[0] Count Only Above Base Level
option (Base Level= 0
) will be fine.If you are unsure about the output value, please ensure your CRS is in line with your expected output units (CRS can be in degrees, meters, and ft).
TLNR;
[SAGA Raster volume]
This tool is usually used for a single raster DEM volume above/below a base level (such as sea surface). To calculate the volume between two raster surface, your approach is the most appropriate. If one of your layer is always higher than the other (that means your 3rd layer is always positive),
[0] Count Only Above Base Level
will do the job.Some additional notes you may be interested in:
[1] Count Only Below Base Level
. (This becomes important when raster layers are crisscrossing...one layer can be above or below the other.)[0]
and[1]
are similar tocut & fill
operation.[GRASS r.volume]
r.clumps
output... sor.volume
is somewhat like cell-counts. It is not for continuous cell values.