Rapid statistics for subareas of a raster map?

hnw at mtqgrass.ESD.ORNL.GOV hnw at mtqgrass.ESD.ORNL.GOV
Fri Aug 21 15:34:42 EDT 1998


I need to calculate n, mean, std, max, and min for a number of patches
in a raster map.

I am currently masking the patch, zooming with g.region, and then using
r.stats to spew the cells to an awk program which calculates the
statistics.

But it takes a long time for g.region to "walk" the edges of the window
down to each individual patch.  But if I don't window in the current
region, it takes r.stats a long time to filter through all of the
masked cells to get to the cells that are in the current patch.

Does anybody know of a better, faster approach for getting summary
stats for patches in a raster map?

     ____                             Oak Ridge National Laboratory
      /  )      /  /      /  /        P.O. Box 2008, M.S. 6274
     /--<   o  /  /      /--/         Oak Ridge, TN  37830-6274
    /___/__<__/__/_     /  / _        (423) 241-2748
   William W. Hargrove                (423) 241-3870 (fax)
   hnw at fire.esd.ornl.gov              http://www.esd.ornl.gov/~hnw



More information about the grass-user mailing list