Hello GT-developers,
the following simple testcase uses the GeoTIFFReader class to simply write the
Bounds to the stdout (in an infinite loop).
On Windows (no issue on Linux), I recognized that the GeoTIFF file keeps beeing
locked, i.e. the lock will not get disposed and on every further loop a new
lock on the file is created.
Now I'm not sure if my simple piece of code is conceptionally wrong or if the
GeoTIFFReader class does not close the InputStream.
Please see following testcase.
The Java code:
http://pastie.org/private/n5ajzlccstefwojnjteyeg
You will need to create a folder:
C:\tmp_geo\
You could download the hardcoded GeoTIFF file from (or use your own with EPSG
code):
ftp://ftp.remotesensing.org/pub/geotiff/samples/usgs/i30dem.tif
Paste the GeoTIFF file and the GeoTIFFReaderTest.java to the tmp_geo folder!
You will need the following libraries from GeoTools 2.7.5 (copy these into the
tmp_geo folder!):
gt-api-2.7.5.jar
gt-coverage-2.7.5.jar
gt-epsg-wkt-2.7.5.jar
gt-geotiff-2.7.5.jar
gt-metadata-2.7.5.jar
gt-opengis-2.7.5.jar
gt-referencing-2.7.5.jar
imageio-ext-tiff-1.1.3.jar
imageio-ext-utilities-1.1.3.jar
jai_codec-1.1.3.jar
jai_core-1.1.3.jar
jai_imageio-1.1.jar
jsr-275-1.0-beta-2.jar
vecmath-1.3.2.jar
compile with:
javac -cp
".;gt-api-2.7.5.jar;gt-coverage-2.7.5.jar;gt-epsg-wkt-2.7.5.jar;gt-geotiff-2.7.5.jar;gt-metadata-2.7.5.jar;gt-opengis-2.7.5.jar;gt-referencing-2.7.5.jar;imageio-ext-tiff-1.1.3.jar;imageio-ext-utilities-1.1.3.jar;jai_codec-1.1.3.jar;jai_core-1.1.3.jar;jai_imageio-1.1.jar;jsr-275-1.0-beta-2.jar;vecmath-1.3.2.jar"
GeoTIFFReaderTest.java
start with:
java -cp
".;gt-api-2.7.5.jar;gt-coverage-2.7.5.jar;gt-epsg-wkt-2.7.5.jar;gt-geotiff-2.7.5.jar;gt-metadata-2.7.5.jar;gt-opengis-2.7.5.jar;gt-referencing-2.7.5.jar;imageio-ext-tiff-1.1.3.jar;imageio-ext-utilities-1.1.3.jar;jai_codec-1.1.3.jar;jai_core-1.1.3.jar;jai_imageio-1.1.jar;jsr-275-1.0-beta-2.jar;vecmath-1.3.2.jar"
GeoTIFFReaderTest
Does the lock on the file result from my piece of code or does the
GeoTIFFReader class not release and close the InputStream?
Could someone please verify?
João
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users