Hi, I'm reading a geotiff (ASTER GDEM) but it fails with the error message 
"One factory fails for the operation "ImageRead"" and "Caused by: 
javax.imageio.IIOException: I/O error reading header!"

I'm not sure if JAI isn't properly set up (but scaling PNGs work for 
example) or the GeoTiff is broken (should be the ASTER GDEM geotiff from 
their page).

I'm using eclipse and maven and geotools 2.6.0, the dependencies are:

  +- org.geotools:gt-geotiff:jar:2.6.0:compile
  |  \- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.0.4:compile
  |     +- it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.0.4:co
  |     +- javax.media:jai_core:jar:1.1.3:compile
  |     +- javax.media:jai_codec:jar:1.1.3:compile
  |     \- javax.media:jai_imageio:jar:1.1:compile

The relevant code is:
                        GeoTiffFormat format = new GeoTiffFormat();
                        reader = format.getReader(source);
                        GridCoverage2D cov = (GridCoverage2D) reader.read(null);


Did anyone successfully import the ASTER data? I found some older post in 
this list but no one had the same problem like me.

Cheers,

Jan

-------------------------------------------------
Stacktrace:

Error: One factory fails for the operation "ImageRead"
Occurs in: javax.media.jai.ThreadSafeOperationRegistry
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
        at 
javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
        at 
javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
        at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
        at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
        at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2179)
        at org.geotools.gce.geotiff.GeoTiffReader.read(GeoTiffReader.java:489)
        at 
Caused by: javax.imageio.IIOException: I/O error reading header!
        at 
it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readHeader(TIFFImageReader.java:246)
        at 
it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.locateImage(TIFFImageReader.java:253)
        at 
it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:327)
        at 
it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getImageTypes(TIFFImageReader.java:763)
        at javax.imageio.ImageReader.getRawImageType(ImageReader.java:665)
        at 
com.sun.media.jai.imageioimpl.ImageReadOpImage.layoutHelper(ImageReadOpImage.java:228)
        at 
com.sun.media.jai.imageioimpl.ImageReadOpImage.<init>(ImageReadOpImage.java:473)
        at 
com.sun.media.jai.imageioimpl.ImageReadCRIF.create(ImageReadCRIF.java:309)
        ... 38 more
Caused by: java.io.EOFException
        at 
javax.imageio.stream.ImageInputStreamImpl.readShort(ImageInputStreamImpl.java:215)
        at 
javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(ImageInputStreamImpl.java:228)
        at 
it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readHeader(TIFFImageReader.java:221)
        ... 45 more

-- 
>From address is valid until 01.06.2010


------------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to