[gdal-dev] calculate raster values within a vector

Jose Gomez-Dans jgomezdans at gmail.com
Wed Aug 26 10:13:08 EDT 2009


Hi,

2009/8/20 questions anon <questions.anon at gmail.com>

> Can anyone get me started on a script that can -
>
>  -Open a shapefile
>
>  -Open many rasters
>
>  -Calculate the mean and standard deviation of those rasters within the
> shapefile region, but is able to ignore areas of zeros or NoData
>
>  -Output the mean and standard deviation to a table
>
i've done a similar example to what you want here:
< http://sites.google.com/site/spatialpython/aggregating-data-to-grid-cells>
Only difference is that I calculate the histogram, rather than just the mean
and std dev. It is trivial to modify this for your own purposes. In fact,
when I get some time, I'll throw in a full "zonal stats" class, but for now
this should get you started.

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090826/0486560e/attachment.html


More information about the gdal-dev mailing list