<span style="font-family:arial,helvetica,sans-serif; font-size:12px">Hi,<br>
<br>
Thank you for the clarification on the clumps, it makes more sense for me 
now.‌<br>
<br>
However you said :</span><br>
<br>
"Ideally, the clump option of r.volume should be optional. You could file<br>
an enhancement wish on trac for that.<span 
style="font-family:arial,helvetica,sans-serif; font-size:12px">"<br>
<br>
But I don't really understand what you mean by "an enhancement wish on trac for 
that", could you explain it a bit more ?<br>
<br>
I tried doing both r.volume and multiplying the sum by the cell size, and I 
have approximately the same results, but there a are some little differences. I 
think it is because, with the second method, I rounded up the results I had, 
because there were too many digits, so I might I lost some precision in my 
results.<br>
<br>
Marion</span><br>
&nbsp;
<div class="gl_quote" style="margin-top: 20px; padding-top: 5px;">De : "Moritz 
Lennert"<br>
A : marion-bru...@sfr.fr,"Markus Neteler" ,"grass-user"<br>
Envoyé: vendredi 13 juillet 2018 17:41<br>
Objet : Re: [GRASS-user] calculate the volume of a DEM with r.volume<br>
&nbsp;
<div class="gl_quoted">On 13/07/18 09:51, marion-bru...@sfr.fr wrote:<br>
&gt; ‌Hello,<br>
&gt;<br>
&gt; I am working on Windows and I tried using GRASS 7.2.2, GRASS 7.4.0 and<br>
&gt; GRASS 7.4.1 to see if there is any difference, but it is always the 
same.<br>
&gt;<br>
&gt; I have a ratser map calleddec-juin<br>
&gt; First I didr.clump input=dec-juin@1217_Interpo0618 output=test<br>
&gt; to get the clumps<br>
&gt; Then I didr.volume input=dec-juin@1217_Interpo0618<br>
&gt; clump=test@1217_Interpo0618<br>
&gt; to have the volume.<br>
<br>
<br>
If dec-juin@1217_Interpo0618 contains your DEM difference, than you will<br>
have different values for each pixel and clumping the map will results<br>
in almost as many clumps as pixels. The clumps are meant to be used to<br>
delineate specific areas for which you want the volume. If you want the<br>
total volume of the entire computational region, you can just create a<br>
map with r.mapcalc like this:<br>
<br>
r.mapcalc "clump = 1"<br>
<br>
and then run<br>
<br>
r.volume input=dec-juin@1217_Interpo0618 clump=clump<br>
<br>
which should give you the total volume.<br>
<br>
Ideally, the clump option of r.volume should be optional. You could file<br>
an enhancement wish on trac for that.<br>
<br>
Then again, as Micha has already explained, you can get the same result<br>
simply doing<br>
<br>
r.sum dec-juin@1217_Interpo0618<br>
<br>
and then multply the result by the area of your pixels (ewres*nsres).<br>
<br>
Moritz<br>
<br>
&gt; The result I have is:<br>
&gt;<br>
&gt; (Fri Jul 13 14:12:45 2018)<br>
&gt; r.volume input=dec-juin@1217_Interpo0618 clump=test@1217_Interpo0618<br>
&gt; Volume report on data from using clumps on<br>
&gt; raster map<br>
&gt; Category&nbsp;&nbsp; Average&nbsp;&nbsp; Data&nbsp;&nbsp; # 
Cells&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Centroid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Total<br>
&gt; Number&nbsp;&nbsp;&nbsp;&nbsp; in clump&nbsp; Total&nbsp; in 
clump&nbsp;&nbsp; Easting&nbsp;&nbsp;&nbsp;&nbsp; 
Northing&nbsp;&nbsp;&nbsp;&nbsp; Volume<br>
&gt; 
-----------------------------------------------------------------------------<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; 
-8.02&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-72&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9&nbsp;&nbsp; 191262.28&nbsp; 
1222178.97<br>
&gt; -22.59<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 
-9.02&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -622&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
69&nbsp;&nbsp; 191265.64&nbsp; 1222177.29<br>
&gt; -194.78<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; 
-8.04&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -394&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
49&nbsp;&nbsp; 191268.44&nbsp; 1222176.73<br>
&gt; -123.30<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 
-7.08&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -276&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
39&nbsp;&nbsp; 191271.23&nbsp; 1222177.85<br>
&gt; -86.46<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 
-5.94&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -427&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
72&nbsp;&nbsp; 191274.59&nbsp; 1222176.73<br>
&gt; -133.75<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp; 
-4.30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -275&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
64&nbsp;&nbsp; 191285.22&nbsp; 1222178.97<br>
&gt; -86.09<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; 
-5.10&nbsp;&nbsp;&nbsp;&nbsp; -2714&nbsp;&nbsp;&nbsp;&nbsp; 532&nbsp;&nbsp; 
191288.58&nbsp; 1222174.50<br>
&gt; -849.47<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp; 
-0.60&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12&nbsp;&nbsp; 191221.43&nbsp; 1222177.29<br>
&gt; -2.27<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9&nbsp;&nbsp;&nbsp;&nbsp; 
-8.95&nbsp;&nbsp;&nbsp;&nbsp; -1030&nbsp;&nbsp;&nbsp;&nbsp; 115&nbsp;&nbsp; 
191230.39&nbsp; 1222176.17<br>
&gt; -322.31<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp; 
-10.06&nbsp;&nbsp;&nbsp;&nbsp; -1217&nbsp;&nbsp;&nbsp;&nbsp; 121&nbsp;&nbsp; 
191245.49&nbsp; 1222175.61<br>
&gt; -380.88<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11&nbsp;&nbsp;&nbsp; 
-10.93&nbsp;&nbsp;&nbsp;&nbsp; -1956&nbsp;&nbsp;&nbsp;&nbsp; 179&nbsp;&nbsp; 
191249.97&nbsp; 1222177.29<br>
&gt; -612.34<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12&nbsp;&nbsp;&nbsp; 
-10.24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -645&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
63&nbsp;&nbsp; 191259.48&nbsp; 1222175.61<br>
&gt; -201.92<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13&nbsp;&nbsp;&nbsp;&nbsp; 
-7.05&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -621&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
88&nbsp;&nbsp; 191329.43&nbsp; 1222177.29<br>
&gt; -194.28<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14&nbsp;&nbsp;&nbsp;&nbsp; 
-7.51&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-60&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp; 191336.14&nbsp; 
1222177.29<br>
&gt; -18.81<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp;&nbsp; 
-7.47&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp; 191337.26&nbsp; 
1222177.29<br>
&gt; -9.35<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16&nbsp;&nbsp;&nbsp;&nbsp; 
-8.04&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -322&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
40&nbsp;&nbsp; 191340.06&nbsp; 1222177.29<br>
&gt; -100.63<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 17&nbsp;&nbsp;&nbsp;&nbsp; 
-8.99&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
12&nbsp;&nbsp; 191343.98&nbsp; 1222177.29<br>
&gt; -33.78<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
4.98&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9&nbsp;&nbsp; 191182.26&nbsp; 
1222175.05<br>
&gt; 14.03<br>
&gt; &nbsp;&nbsp; &nbsp;&nbsp; etc<br>
&gt; &nbsp;&nbsp; &nbsp;&nbsp; etc<br>
&gt; &nbsp;&nbsp; 24458&nbsp;&nbsp;&nbsp;&nbsp; 
-5.50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp; 191397.13&nbsp; 
1221585.50<br>
&gt; -6.88<br>
&gt; &nbsp;&nbsp; 24459&nbsp;&nbsp;&nbsp;&nbsp; 
-5.51&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp; 191378.11&nbsp; 
1221584.39<br>
&gt; -10.34<br>
&gt; &nbsp;&nbsp; 24460&nbsp;&nbsp;&nbsp;&nbsp; 
-5.52&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp; 191380.91&nbsp; 
1221584.39<br>
&gt; -3.45<br>
&gt; &nbsp;&nbsp; 24461&nbsp;&nbsp;&nbsp;&nbsp; -5.27&nbsp;&nbsp;&nbsp; 
-30348&nbsp;&nbsp;&nbsp; 5764&nbsp;&nbsp; 191309.84&nbsp; 1221601.17<br>
&gt; -9498.51<br>
&gt; &nbsp;&nbsp; 24462&nbsp;&nbsp;&nbsp;&nbsp; 
-5.49&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 191358.53&nbsp; 
1221582.15<br>
&gt; -12.02<br>
&gt; &nbsp;&nbsp; 24463&nbsp;&nbsp;&nbsp;&nbsp; 
-5.49&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp; 191363.56&nbsp; 
1221583.83<br>
&gt; -6.87<br>
&gt; &nbsp;&nbsp; 24464&nbsp;&nbsp;&nbsp;&nbsp; 
-5.48&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp; 191385.38&nbsp; 
1221583.83<br>
&gt; -3.43<br>
&gt; &nbsp;&nbsp; 24465&nbsp;&nbsp;&nbsp;&nbsp; 
-5.49&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp; 191387.06&nbsp; 
1221583.83<br>
&gt; -3.44<br>
&gt; &nbsp;&nbsp; 24466&nbsp;&nbsp;&nbsp;&nbsp; 
-5.50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp; 191388.74&nbsp; 
1221583.83<br>
&gt; -3.44<br>
&gt; &nbsp;&nbsp; 24467&nbsp;&nbsp;&nbsp;&nbsp; 
-5.50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp; 191360.20&nbsp; 
1221582.71<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -6.88<br>
&gt; &nbsp;&nbsp; 24468&nbsp;&nbsp;&nbsp;&nbsp; -5.92&nbsp;&nbsp; 
-523187&nbsp;&nbsp; 88358&nbsp;&nbsp; 191241.58&nbsp; 1221675.00<br>
&gt; -163750.63<br>
&gt; (Fri Jul 13 14:13:03 2018) La commande s'est terminée (18 sec)<br>
&gt;<br>
&gt; As you can see, I have nothing at the end of the command... But I know<br>
&gt; it is finished, because when I created the clumps it said that it<br>
&gt; created 24468 clumps.<br>
&gt; Do you need any more information?<br>
&gt;<br>
&gt;<br>
&gt; Thank you very much<br>
&gt; De : "Markus Neteler"<br>
&gt; A : marion-bru...@sfr.fr,"grass-user"<br>
&gt; Envoyé: jeudi 12 juillet 2018 16:43<br>
&gt; Objet : Re: [GRASS-user] calculate the volume of a DEM with r.volume<br>
&gt; Hello Marion,<br>
&gt;<br>
&gt; On Wed, Jul 11, 2018 at 10:32 AM, &nbsp;&gt; &gt; wrote:<br>
&gt; &gt; Hello,<br>
&gt; &gt;<br>
&gt; &gt; I tried using r.volume as you suggested.&nbsp; According to the<br>
&gt; documentation it<br>
&gt; &gt; is suitable for what I am trying to do.<br>
&gt; &gt;<br>
&gt; &gt; However, when I use it, I don't have the "Total volume" line at 
the<br>
&gt; end of<br>
&gt; &gt; the report, like it is shown in the documentation. I just have the 
total<br>
&gt; &gt; volume of each clump, but not of all the clumps... Has it ever<br>
&gt; happened to<br>
&gt; &gt; you when using this command?<br>
&gt;<br>
&gt; That's weird! Which version/operating system do you use?<br>
&gt;<br>
&gt; &gt; in the command line<br>
&gt; &gt;<br>
&gt; &gt; I simply wroter.volume input=difference clump=clump in the command 
line<br>
&gt;<br>
&gt;<br>
&gt; Here on command line:<br>
&gt;<br>
&gt; GRASS 7.4.1svn (nc_spm_08_grass7):~ &gt; g.region raster=elevation<br>
&gt; GRASS 7.4.1svn (nc_spm_08_grass7):~ &gt; r.volume input=elevation<br>
&gt; clump=geology_30m<br>
&gt; &nbsp;100%<br>
&gt;<br>
&gt; Volume report on data from using clumps on<br>
&gt; raster map<br>
&gt;<br>
&gt; Category &nbsp; Average &nbsp; Data &nbsp; # Cells &nbsp; &nbsp; &nbsp; 
&nbsp;Centroid &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Total<br>
&gt; Number &nbsp; &nbsp; in clump &nbsp;Total &nbsp;in clump &nbsp; Easting 
&nbsp; &nbsp; Northing &nbsp; &nbsp; Volume<br>
&gt; 
-----------------------------------------------------------------------------<br>
&gt; &nbsp; &nbsp; &nbsp;217 &nbsp; &nbsp;118.93 &nbsp;86288828 &nbsp;725562 
&nbsp; 635325.00 &nbsp; 221535.00<br>
&gt; &nbsp;8628882798.63<br>
&gt; &nbsp; &nbsp; &nbsp;262 &nbsp; &nbsp;108.97 &nbsp;21650560 &nbsp;198684 
&nbsp; 638935.00 &nbsp; 222495.00<br>
&gt; &nbsp;2165056037.02<br>
&gt; &nbsp; &nbsp; &nbsp;270 &nbsp; &nbsp; 92.23 &nbsp;63578874 &nbsp;689373 
&nbsp; 642405.00 &nbsp; 221485.00<br>
&gt; &nbsp;6357887443.53<br>
&gt; &nbsp; &nbsp; &nbsp;405 &nbsp; &nbsp;132.96 &nbsp;33732662 &nbsp;253710 
&nbsp; 631835.00 &nbsp; 224095.00<br>
&gt; &nbsp;3373266208.59<br>
&gt; &nbsp; &nbsp; &nbsp;583 &nbsp; &nbsp;139.35 &nbsp; 3011288 &nbsp; 21609 
&nbsp; 630205.00 &nbsp; 224665.00<br>
&gt; 301128821.55<br>
&gt; &nbsp; &nbsp; &nbsp;720 &nbsp; &nbsp;124.30 &nbsp; &nbsp;599618 &nbsp; 
&nbsp;4824 &nbsp; 634075.00 &nbsp; 227995.00<br>
&gt; &nbsp;59961816.06<br>
&gt; &nbsp; &nbsp; &nbsp;766 &nbsp; &nbsp;132.43 &nbsp; &nbsp;936791 &nbsp; 
&nbsp;7074 &nbsp; 631425.00 &nbsp; 227845.00<br>
&gt; &nbsp;93679120.08<br>
&gt; &nbsp; &nbsp; &nbsp;862 &nbsp; &nbsp;118.31 &nbsp; 7302317 &nbsp; 61722 
&nbsp; 630505.00 &nbsp; 218885.00<br>
&gt; 730231746.74<br>
&gt; &nbsp; &nbsp; &nbsp;910 &nbsp; &nbsp; 94.20 &nbsp; 4235816 &nbsp; 44964 
&nbsp; 639215.00 &nbsp; 216365.00<br>
&gt; 423581613.11<br>
&gt; &nbsp; &nbsp; &nbsp;921 &nbsp; &nbsp;135.22 &nbsp; 1693985 &nbsp; 12528 
&nbsp; 630755.00 &nbsp; 215445.00<br>
&gt; 169398523.05<br>
&gt; &nbsp; &nbsp; &nbsp;945 &nbsp; &nbsp;127.24 &nbsp; &nbsp; &nbsp;1145 
&nbsp; &nbsp; &nbsp; 9 &nbsp; 630015.00 &nbsp; 215015.00<br>
&gt; &nbsp;114512.03<br>
&gt; &nbsp; &nbsp; &nbsp;946 &nbsp; &nbsp; 89.91 &nbsp; &nbsp;365748 &nbsp; 
&nbsp;4068 &nbsp; 639085.00 &nbsp; 215255.00<br>
&gt; &nbsp;36574833.85<br>
&gt; &nbsp; &nbsp; &nbsp;948 &nbsp; &nbsp;129.02 &nbsp; &nbsp;112632 &nbsp; 
&nbsp; 873 &nbsp; 630185.00 &nbsp; 215115.00<br>
&gt; &nbsp;11263181.57<br>
&gt; 
-----------------------------------------------------------------------------<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; Total Volume =<br>
&gt; 22351026655.81<br>
&gt; ... which looks ok.<br>
&gt; Can you say a bit more about your system?<br>
&gt; Markus<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; grass-user mailing list<br>
&gt; grass-user@lists.osgeo.org<br>
&gt; https://lists.osgeo.org/mailman/listinfo/grass-user<br>
&gt;<br>
&nbsp;</div>

<div class="gl_quoted">&nbsp;</div>
</div>
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to