[gdal-dev] zonal statistics with gdal

Alexander Bruy alexander.bruy at gmail.com
Tue Jun 19 10:15:33 PDT 2012


Hi,

you can use GDAL Python bindigs for this [0, 1]. The process may look
as open shape and raster, then convert pixel coordinates into map (shape)
coordinates and process only pixels inside your polygon.

[0] http://gdal.org/gdal_tutorial.html
[1] http://gdal.org/ogr/ogr_apitut.html

2012/6/19 jdmorgan <jdmorgan at unca.edu>:
> Hello,
>
> Is there a way to do something along the lines of zonal statistics with
> gdal.  Basically, I have a county shape file and a classified raster
> dataset.  I would like to count the number of raster pixels/county (FIPS).
> Is this possible with GDAL/OGR?  If so can someone point me in the right
> direction?  If so, awesome as I plan to do some automation with python.
>
> Thanks,
>
> Derek

Hope this helps
-- 
Alexander Bruy


More information about the gdal-dev mailing list