I did a quick test with the normal GridFormatFinder and it works to read 
ArcGrid ASCII:

final File f = TestData.file(this, "ArcGrid.asc"); // Reading the coverage 
through a file  AbstractGridFormat format = GridFormatFinder.findFormat( f ); 
AbstractGridCoverage2DReader reader = format.getReader(f); GridCoverage2D gc = 
reader.read(null);

I have updated the documentation page:
- http://docs.geotools.org/latest/userguide/library/coverage/arcgrid.html

-- 
Jody Garnett

On Tuesday, 10 May 2011 at 4:37 AM, Nick Malleson wrote: 
> 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
> 
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to