averaging raster layers

Nalneesh Gaur ngaur at apwk01g3.abrfc.noaa.gov
Thu Mar 31 09:58:14 EST 1994


Use the following awk line to do this:

	r.stats -c <dem_layer> | awk 'BEGIN{countcells=0; adddems=0}\
{countcells += $2; adddems += $1*$2}\
END{print "The average is:",adddems/countcells}'

You may modify it if you wish.

Nalneesh Gaur, River Forecast Center, TULSA  



More information about the grass-user mailing list