On 07/09/2018 06:05 AM, marion-brunet
wrote:
Hello,Hi A DEM is usually elevation above sea level, so the "volume of a DEM" would be the the total volume from sea level to the DEM elevation. Is that what you want? Usually you want the volume between two rasters: the DEM and some base elevation. So you need to begin with a simple r.mapcalc _expression_ to get the difference bwteen the DEM and the base elevation. You can get the cell size simply from r.info Then r.univar gives the total of the cell values in it's "sum" output. So putting it all together, i.e.: GRASS 7.4.0 (ITM):~ > r.info -g faran_lidar | grep "res" nsres=1 ewres=1 # Cell size of 1 meter GRASS 7.4.0 (ITM):~ > r.info -r faran_lidar min=73.83 max=297.64 # Min max values Suppose I want the volume above 150 meters: # Always remember to set region GRASS 7.4.0 (ITM):~ > g.region -p rast=faran_lidar # Prepare the "cut" raster between 150 and the DEM r.mapcalc "faran_cut = if(faran_lidar>150, faran_lidar, null())" # And get the sum of all cells: GRASS 7.4.0 (ITM):~ > r.univar faran_cut | grep sum 100% sum: 840009490.273132 # Total 840 million cubic meters Done Yes
-- Micha Silver Ben Gurion Univ. Sde Boker, Remote Sensing Lab cell: +972-523-665918 |
_______________________________________________ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user