Simone Giannecchini wrote:
I simplified the code a bit but the exception remains:
import java.io.IOException;
import java.io.InputStream;
import org.geotools.coverage.grid.GridCoverage2D;
import org.geotools.data.DataSourceException;
import org.geotools.gce.geotiff.GeoTiffFormat;
import org.geotools.gce.geotiff.GeoTiffReader;
import org.geotools.geometry.DirectPosition2D;
import org.geotools.geometry.Envelope2D;
import org.opengis.coverage.grid.GridEnvelope;
import org.opengis.geometry.DirectPosition;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.springframework.util.Assert;
import com.vividsolutions.jts.geom.Coordinate;
GeoTiffReader reader = new GeoTiffReader(source);
GridCoverage2D cov = (GridCoverage2D) reader.read(null);
//here it fails
My system config is:
maven, geotools 2.6.4,
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
I tested it within eclipse and on the command line.
[INFO] | | +- org.geotools:gt-geotiff:jar:2.6.4:compile
[INFO] | | | \- it.geosolutions.imageio-ext:imageio-ext-
tiff:jar:1.0.5:compile
[INFO] | | | +- it.geosolutions.imageio-ext:imageio-ext-
utilities:jar:1.0.5:compile
[INFO] | | | +- javax.media:jai_core:jar:1.1.3:compile
[INFO] | | | +- javax.media:jai_codec:jar:1.1.3:compile
[INFO] | | | \- javax.media:jai_imageio:jar:1.1:compile
Attached the stacktrace,
Cheers, Jan
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:480)
at
de.komoot.hcn.server.analyser.filter.DEMAltitudeReader.addHeight(DEMAltitudeReader.java:39)
at
de.komoot.hcn.server.analyser.calculators.DEMReaderTest.testAddHeight(DEMReaderTest.java:28)
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
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException:
Source or destination region is empty.
at
com.sun.media.jai.imageioimpl.ImageReadCRIF.create(ImageReadCRIF.java:317)
... 38 more
Caused by: java.lang.IllegalArgumentException: Source or destination region
is empty.
at
com.sun.media.jai.imageioimpl.ImageReadOpImage.computeRegions(ImageReadOpImage.java:454)
at
com.sun.media.jai.imageioimpl.ImageReadOpImage.layoutHelper(ImageReadOpImage.java:257)
at
com.sun.media.jai.imageioimpl.ImageReadOpImage.<init>(ImageReadOpImage.java:473)
at
com.sun.media.jai.imageioimpl.ImageReadCRIF.create(ImageReadCRIF.java:309)
... 38 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