[GRASS-user] calculate the volume of a DEM with r.volume

marion-brunet at sfr.fr marion-brunet at sfr.fr
Sun Jul 15 04:52:29 PDT 2018


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

<div class="gl_quoted"> </div>
</div>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180715/4a5a8f39/attachment.html>


More information about the grass-user mailing list