Hi, I was wondering if anyone has some advice about calculating zonal statistics from a raster file. Basically I have a raster DTM and a polygon shapefile and I want to calculate, for each area in the shapefile, the average height values of all pixels within that area. (Exactly the same thing that the "Zonal Statistics" function in ArcMap).
The information about a http://docs.geotools.org/latest/userguide/library/coverage/grid.html GridCoverage looks relevant, but my data is in ArcGrid ASCII format and as far as I can see at the moment only TIFF data are supported. I've also had a look at the discussion about the ArcGridReader class http://osgeo-org.1803224.n2.nabble.com/Reading-Ascii-Grid-td5470106.html here but I think that the class is no longer used (I'm using GeoTools version 8 and can't find an artefact matching the class name using maven/NetBeans). As the raster data is in text format I suppose I could read it in myself and manually find out in which area each pixel is located (by creating a Point object from pixel centroids and using the within() function with objects in the shapefile) but I'd hoped that someone would have written this already. In particular I'm sure there's a more accurate way of deciding which pixel is in which zone rather than just using the centroids. Any help would be really appreciated, Nick Malleson -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Calculating-zonal-statistics-for-a-grid-coverage-tp6345278p6345278.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
