Hi,

I extract one coord value on hundreds of geotiff files.
I use this code

// loop on files

AbstractGridFormat format = GridFormatFinder.findFormat( file );
GridCoverage2DReader reader = format.getReader( file );

GridCoverage2D cov = null;
try {
    cov = reader.read(null);
    DirectPosition pos = new
DirectPosition2D(cov.getCoordinateReferenceSystem(),lat, lon);
    double[] val = cov.evaluate(pos, (double[]) null);
    return val;
} catch (IOException giveUp) {
    throw new RuntimeException(giveUp);
} finally {
    reader.dispose();
    cov.dispose(true);
}

I have a too many open files issue with those files on tomcat.
I see all .tiff files with the command: ls -la /proc/11826/fd | grep .tif

Seems the inputstream of the reader on dispose() throw an exception on
close().

Would you know why it's not clean properly and tiff are not closed ?

Thanks.


-- 
*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

*Florent Gravin*
0479444492
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to