1

I'm trying to calculate the volumes of depression areas filled with water. I have the depth for each cell in the raster, and I'm trying to get the total volume of cells adjacent to each other. Which I then, in step 2, need to remove all the bodies of water lower than a given threshold and then convert the file to vector/shp format.

I've trying using the r.clump and then r.volume function in qgis, but I keep getting this error:

ERROR: r.volume: Sorry, is not a valid parameter ERROR: Required parameter not set: (Name of input raster map representing data that will be summed within clumps)

C:\PROGRA~1\QGIS2~1.18\bin>v.out.ogr -s -e input=centroids0814b2718bf14943909f424cebd714fb type=auto output="C:\Users\JGJ\AppData\Local\Temp\processing503b826c304e474ebc5a9862a9dd29e1\b97bc604e110497ab8dde2cc3da478e7" format=ESRI_Shapefile output_layer=centroids ERROR: Vector map not found

C:\PROGRA~1\QGIS2~1.18\bin>exit Converting outputs Loading resulting layers

The following layers were not correctly generated. Centroids You can check the log messages to find more information about the execution of the algorithm

I could not get the above to work, but managed a workaround.

I have converted raster to vector, and calculated each polygons volume. I have a lot of polygons I want to dissolve into a lot of larger polygons, which can be done with Dissolve. However each of the small polygon has a volume too it, that needs to be summed up. If I do a dissolve it just adds the total volume of all the polygons in the layer, and not those that get dissolved. Added a concept picture.

enter image description here

  • Are you loading the output from the first step directly from the Temp folder? It seems like QGIS doesn't recognize the vector layer, so maybe try to store it to the disk before running the second step. Otherwise, try adding more detail about your issue. – mgri May 17 '17 at 7:55
  • Thank you for the reply. I pretty much just tried the do the R.clump and then the R.volume, where you put in the raster for both and that's it. Ran it from C:\ folder, not a temp one. I've managed to do a work around, and have got so far as I now have a polygon layer as vector format with a lot different polygons that need to be dissolved and their volume fields for those that are dissolved needs to be summed up. Updated question with picture and new description. Don't know if I should delete the old bit. – FoolzRailer May 17 '17 at 12:14
1

Are you aware that the output from r.clump does not have the depths? Each clump is given a unique category value, so you no longer have the cell depths. You can get the area of each clump, but not the total volume.

If I understand correctly your goal, you should convert the "clumps" to a polygon vector, then use v.rast.stats to get the total depth for each clump area. i.e.:

v.rast.stats map=clumps raster=depths column_pref=depth method=sum,minimum,maximum,range

This will add four new columns to the area vector of "clumps" with total volume, min and max depths, and the range of depths.

I'd also suggest you try to do this procedure directly in GRASS, rather than thru the processing toolbox in QGIS.

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.