I have two rasters from which i want to calculate the volume difference between the two. I made a 3rd raster that shows the difference between the first two rasters.

So i think calculating the volume of the third raster is an answer to my question. But how do i do this?

I have tried r.volume with GRASS but i get the error "Data source is invalid"

With saga raster volume. I get results but i'm unsure of the accuracy. I'm also unsure to which method i should use here. "Count only above base level" or others.

1 original situation

2 after construction

3 enter image description here


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).


[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:

  • If there is negative value in your 3rd layer, that part is covered by [1] Count Only Below Base Level. (This becomes important when raster layers are crisscrossing...one layer can be above or below the other.)
  • So, you may think options [0] and [1] are similar to cut & fill operation.
  • About the accuracy: ... The measurement is based on map unit. If there is doubt, please double-check your projection CRS and measurement unit in the Project menu.
  • Please also note this tool calculate the volume over the entire region. If you need to limit the area (e.g. only inside a polygon) please clip the raster by the polygon as a pre-processing.

[GRASS r.volume]

  • This tool is to calculate so-called "clumps", which is a kind of mass (body) of categorical cells.
  • Input is commonly taken from r.clumpsoutput... so r.volume is somewhat like cell-counts. It is not for continuous cell values.
  • thanks. I expect raster layers are criscrossing. Do i need to take the resolution of the rasters into account?
    – user115595
    Mar 29 '18 at 9:17
  • @user115595 As far as I know resolution has not affected the output if the raster layer are on projected CRS. (Always better to double-check, though...)
    – Kazuhito
    Mar 29 '18 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.