[GRASS-user] Calculate statistics for raster values in polygons

Greetings

I have a vectorial data that divides my region in sub-areas. I want to calculate the average value of a raster but instead for all pixel values, I want to calculate the average of pixel values that are inside each polygonIs this possible in GRASS? If yes, how?
Thank you
Luis

Try to transform your vector areas into a raster map, afterwards you are able to use r.statistics (now, former polygons as the raster base map and desired raster as the cover map)…that should work!

Regards,
Christian.

From: Luis Lisboa
Sent: Wednesday, April 21, 2010 7:03 PM
To: GRASS user list
Subject: [GRASS-user] Calculate statistics for raster values in polygons

Greetings

I have a vectorial data that divides my region in sub-areas. I want to calculate the average value of a raster but instead for all pixel values, I want to calculate the average of pixel values that are inside each polygonIs this possible in GRASS? If yes, how?
Thank you
Luis



grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Luis Lisboa pisze:

Greetings

I have a vectorial data that divides my region in sub-areas. I want to calculate the average value of a raster but instead for all pixel values, I want to calculate the average of pixel values that are inside each polygonIs this possible in GRASS? If yes, how?
Thank you
Luis
------------------------------------------------------------------------

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
  

v.rast.stats

On Wed, Apr 21, 2010 at 7:21 PM, Jarek Jasiewicz <jarekj@amu.edu.pl> wrote:

Luis Lisboa pisze:

Greetings

I have a vectorial data that divides my region in sub-areas. I want to
calculate the average value of a raster but instead for all pixel values, I
want to calculate the average of pixel values that are inside each polygonIs
this possible in GRASS? If yes, how?

...

v.rast.stats

Or how about r.univar.zonal?
http://grass.osgeo.org/wiki/Addons#r.univar.zonal

Markus

Hi all
I’m reading the v.rast.stats Help and I’m a bit confused. It says “Calculates basic univariate statistics from a raster map only for the parts covered by the specified vector map”. But for instance if all my region is covered by different polygons and, if I want to calculate for each polygon my average value from raster, is this function helpful? (e.g. I have vector with zip codes for my region and I want to calculate average elevation of each zip code).

On Wed, Apr 21, 2010 at 6:21 PM, Jarek Jasiewicz <jarekj@amu.edu.pl> wrote:

Luis Lisboa pisze:

Greetings

I have a vectorial data that divides my region in sub-areas. I want to calculate the average value of a raster but instead for all pixel values, I want to calculate the average of pixel values that are inside each polygonIs this possible in GRASS? If yes, how?
Thank you
Luis



grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

v.rast.stats

Luis Lisboa wrote:

Hi all
I'm reading the v.rast.stats Help and I'm a bit confused. It says "Calculates basic univariate statistics from a raster map only for the parts covered by the specified vector map". But for instance if all my region is covered by different polygons and, if I want to calculate for each polygon my average value from raster, is this function helpful? (e.g. I have vector with

yes, exactly the function you need. It adds nine attribute columns to your vector layer with min,max,mean, etc values calculated from the raster.

zip codes for my region and I want to calculate average elevation of each zip code).

On Wed, Apr 21, 2010 at 6:21 PM, Jarek Jasiewicz <jarekj@amu.edu.pl <mailto:jarekj@amu.edu.pl>> wrote:

    Luis Lisboa pisze:

        Greetings

        I have a vectorial data that divides my region in sub-areas. I
        want to calculate the average value of a raster but instead
        for all pixel values, I want to calculate the average of pixel
        values that are inside each polygonIs this possible in GRASS?
        If yes, how?
        Thank you
        Luis
        ------------------------------------------------------------------------

        _______________________________________________
        grass-user mailing list
        grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/grass-user
         
    v.rast.stats

This mail was received via Mail-SeCure System.
------------------------------------------------------------------------

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

--
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il