El 14/03/13 05:30, Lauchlin Wilkinson escribió:
I mean, geotools base library should implement the methods getMax,
getMin and getNoDataValue, but not the methods I wrote, because,
in fact, these methods are incomplete and runs well only in a few
ways.
Thanks Andrea.
Just to update this again...
Actually this is probably all you need to do if you are happy to read
the whole grid in to memory. It is using the underlying geotools
library from...geosolutions :) The code for getting the min and max
looks like it has just been moved from that class you were looking at
earlier.
import it.geosolutions.imageio.plugins.arcgrid.AsciiGridsImageReader;
import
it.geosolutions.imageio.plugins.arcgrid.spi.AsciiGridsImageReaderSpi;
.
.
.
file = new File("/path/to/your.asc");
AsciiGridsImageReader aa = new AsciiGridsImageReader(null);
aa.setInput(file);
// 0 is the index of the band you want to read...ASCII usually only
has one band anyway AFAIK
aa.read(0);
System.out.println(aa.getRasterReader().getMaxValue());
System.out.println(aa.getRasterReader().getMinValue());
System.out.println(aa.getRasterReader().getNoData());
it runs well!!!.
I have one more question but I will open other thread to talk about it.
Thanks a lot!!!
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users