From: Simone G. <sim...@ge...> - 2009-06-30 11:35:42
|
Ciao Jon, please read below... ------------------------------------------------------- Ing. Simone Giannecchini GeoSolutions S.A.S. Owner - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob: +39 333 8128928 http://www.geo-solutions.it http://simboss.blogspot.com/ http://www.linkedin.com/in/simonegiannecchini ------------------------------------------------------- On Tue, Jun 30, 2009 at 1:26 PM, Jon Britton<jbr...@gl...> wrote: > > Hi, > > No, I've got it in my POM but I don't have the eclipse project in my build > path. However, I do have gt-xsd-wcs (my own slightly modified version) in > my build path, which has gt-coverage is IT'S build path... would this have > any effect? If gt-xsd-wxs is added as a project, I think that would cause the problem. As a jar, I would say no, but I would have to think harder problably :-). This definitely looks like a classpath problem. Simone. > > Also, when I try and write my coverage to a file (rather than directly into > a GridCoverage2D) I still get the "A descriptor is already registered > against the name..." errors. However, I seem to be able to load the > coverage without any problem so now I'm wondering if my JAI problem is > actually causing the exception I got previously. I think so. > > Thanks, > > Jon > > > > Simone Giannecchini wrote: >> >> Ciao Jon, >> can you check if you have, by accident, added the coverage module >> twice to your project, as an instace jar + eclipse project itself. >> >> Simone. >> ------------------------------------------------------- >> Ing. Simone Giannecchini >> GeoSolutions S.A.S. >> Owner - Software Engineer >> Via Carignoni 51 >> 55041 Camaiore (LU) >> Italy >> >> phone: +39 0584983027 >> fax: +39 0584983027 >> mob: +39 333 8128928 >> >> >> http://www.geo-solutions.it >> http://simboss.blogspot.com/ >> http://www.linkedin.com/in/simonegiannecchini >> >> ------------------------------------------------------- >> >> >> >> On Tue, Jun 30, 2009 at 1:02 PM, Jon Britton<jbr...@gl...> wrote: >>> >>> I've uninstalled JAI and ImageIO from my JDK and tried again, but I get >>> the >>> same problem. >>> >>> Yes, I'm running from Eclipse. >>> >>> Thanks, >>> >>> Jon >>> >>> >>> Simone Giannecchini wrote: >>>> >>>> It might be loaded twice, especially if it is deployed in ext/libs of >>>> your >>>> jdk. >>>> Are running things from eclipse? >>>> >>>> >>>> Simone. >>>> ------------------------------------------------------- >>>> Ing. Simone Giannecchini >>>> GeoSolutions S.A.S. >>>> Owner - Software Engineer >>>> Via Carignoni 51 >>>> 55041 Camaiore (LU) >>>> Italy >>>> >>>> phone: +39 0584983027 >>>> fax: +39 0584983027 >>>> mob: +39 333 8128928 >>>> >>>> >>>> http://www.geo-solutions.it >>>> http://simboss.blogspot.com/ >>>> http://www.linkedin.com/in/simonegiannecchini >>>> >>>> ------------------------------------------------------- >>>> >>>> >>>> >>>> On Fri, Jun 26, 2009 at 5:22 PM, Jon Britton<jbr...@gl...> wrote: >>>>> >>>>> Hey, >>>>> >>>>> I've just realised I've probably got JAI installed on my system as >>>>> normal, >>>>> but I've also got it in my POM. Could that cause this problem? >>>>> >>>>> Thanks, >>>>> >>>>> Jon >>>>> >>>>> >>>>> Simone Giannecchini wrote: >>>>>> >>>>>> Ciao Jon, >>>>>> this error happens sometimes in eclispe when you mess up the jai >>>>>> installation and the geotools jai registration file get loaded >>>>>> multiple times. >>>>>> Can you give me a bit of more information on what you are doing do >>>>>> that I can help out (also with the geotiff thing :-)). >>>>>> >>>>>> Simone. >>>>>> ------------------------------------------------------- >>>>>> Ing. Simone Giannecchini >>>>>> GeoSolutions S.A.S. >>>>>> Owner - Software Engineer >>>>>> Via Carignoni 51 >>>>>> 55041 Camaiore (LU) >>>>>> Italy >>>>>> >>>>>> phone: +39 0584983027 >>>>>> fax: +39 0584983027 >>>>>> mob: +39 333 8128928 >>>>>> >>>>>> >>>>>> http://www.geo-solutions.it >>>>>> http://simboss.blogspot.com/ >>>>>> http://www.linkedin.com/in/simonegiannecchini >>>>>> >>>>>> ------------------------------------------------------- >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Jun 26, 2009 at 12:06 PM, Jon Britton<jbr...@gl...> >>>>>> wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I was trying this: >>>>>>> >>>>>>> reader = new GeoTiffReader(this.getInputStream()); >>>>>>> GridCoverage2D image = (GridCoverage2D)reader.read(null); >>>>>>> >>>>>>> However, I get a number of exceptions: >>>>>>> >>>>>>> Error while parsing JAI registry file >>>>>>> "/D:/geotools/2.5.x/modules/library/coverage/target/classes/META-INF/registryFile.jai" >>>>>>> : >>>>>>> Error in registry file at line number #31 >>>>>>> A descriptor is already registered against the name >>>>>>> "org.geotools.Combine" >>>>>>> under registry mode "rendered" >>>>>>> Error in registry file at line number #32 >>>>>>> A descriptor is already registered against the name >>>>>>> "org.geotools.Hysteresis" under registry mode "rendered" >>>>>>> Error in registry file at line number #33 >>>>>>> A descriptor is already registered against the name >>>>>>> "org.geotools.NodataFilter" under registry mode "rendered" >>>>>>> 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:585) >>>>>>> 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:461) >>>>>>> at >>>>>>> org.geotools.data.wcs.response.GetCoverageResponse.getCoverage(GetCoverageResponse.java:46) >>>>>>> at uk.ac.glam.jbritton.test.WCSTest.main(WCSTest.java:90) >>>>>>> Caused by: java.lang.RuntimeException: javax.imageio.IIOException: >>>>>>> I/O >>>>>>> error >>>>>>> reading image metadata! >>>>>>> at >>>>>>> com.sun.media.jai.imageioimpl.ImageReadCRIF.create(ImageReadCRIF.java:317) >>>>>>> ... 14 more >>>>>>> Caused by: javax.imageio.IIOException: I/O error reading image >>>>>>> metadata! >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:340) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:310) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.getImageTypes(TIFFImageReader.java:741) >>>>>>> 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) >>>>>>> ... 14 more >>>>>>> Caused by: java.io.EOFException >>>>>>> at >>>>>>> javax.imageio.stream.ImageInputStreamImpl.readShort(ImageInputStreamImpl.java:211) >>>>>>> at >>>>>>> javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(ImageInputStreamImpl.java:222) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFIFD.initialize(TIFFIFD.java:194) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageMetadata.initializeFromStream(TIFFImageMetadata.java:110) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:336) >>>>>>> ... 20 more >>>>>>> Exception in thread "main" javax.media.jai.util.ImagingException: All >>>>>>> factories fail for the operation "ImageRead" >>>>>>> at >>>>>>> javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1687) >>>>>>> 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:461) >>>>>>> at >>>>>>> org.geotools.data.wcs.response.GetCoverageResponse.getCoverage(GetCoverageResponse.java:46) >>>>>>> at uk.ac.glam.jbritton.test.WCSTest.main(WCSTest.java:90) >>>>>>> Caused by: 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:585) >>>>>>> at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122) >>>>>>> at >>>>>>> javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674) >>>>>>> ... 8 more >>>>>>> Caused by: java.lang.RuntimeException: javax.imageio.IIOException: >>>>>>> I/O >>>>>>> error >>>>>>> reading image metadata! >>>>>>> at >>>>>>> com.sun.media.jai.imageioimpl.ImageReadCRIF.create(ImageReadCRIF.java:317) >>>>>>> ... 14 more >>>>>>> Caused by: javax.imageio.IIOException: I/O error reading image >>>>>>> metadata! >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:340) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:310) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.getImageTypes(TIFFImageReader.java:741) >>>>>>> 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) >>>>>>> ... 14 more >>>>>>> Caused by: java.io.EOFException >>>>>>> at >>>>>>> javax.imageio.stream.ImageInputStreamImpl.readShort(ImageInputStreamImpl.java:211) >>>>>>> at >>>>>>> javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(ImageInputStreamImpl.java:222) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFIFD.initialize(TIFFIFD.java:194) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageMetadata.initializeFromStream(TIFFImageMetadata.java:110) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:336) >>>>>>> ... 20 more >>>>>>> Caused by: >>>>>>> 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:585) >>>>>>> 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:461) >>>>>>> at >>>>>>> org.geotools.data.wcs.response.GetCoverageResponse.getCoverage(GetCoverageResponse.java:46) >>>>>>> at uk.ac.glam.jbritton.test.WCSTest.main(WCSTest.java:90) >>>>>>> Caused by: java.lang.RuntimeException: javax.imageio.IIOException: >>>>>>> I/O >>>>>>> error >>>>>>> reading image metadata! >>>>>>> at >>>>>>> com.sun.media.jai.imageioimpl.ImageReadCRIF.create(ImageReadCRIF.java:317) >>>>>>> ... 14 more >>>>>>> Caused by: javax.imageio.IIOException: I/O error reading image >>>>>>> metadata! >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:340) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:310) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.getImageTypes(TIFFImageReader.java:741) >>>>>>> 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) >>>>>>> ... 14 more >>>>>>> Caused by: java.io.EOFException >>>>>>> at >>>>>>> javax.imageio.stream.ImageInputStreamImpl.readShort(ImageInputStreamImpl.java:211) >>>>>>> at >>>>>>> javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(ImageInputStreamImpl.java:222) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFIFD.initialize(TIFFIFD.java:194) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageMetadata.initializeFromStream(TIFFImageMetadata.java:110) >>>>>>> at >>>>>>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(TIFFImageReader.java:336) >>>>>>> ... 20 more >>>>>>> >>>>>>> >>>>>>> >>>>>>> Gabriel Roldan wrote: >>>>>>>> >>>>>>>> By looking at the code it seems you can just do: >>>>>>>> InputStream in = ... >>>>>>>> GeotiffReader reader = new GeotiffReader(in); >>>>>>>> RenderedImage image = >>>>>>>> ((GridCoverage2D)reader.read(null)).view(ViewType.GEOPHYSICS); >>>>>>>> >>>>>>>> cheers, >>>>>>>> Gabriel >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I've got a working(ish) WCS client, now I'm wondering if it's >>>>>>>>> possible >>>>>>>>> to >>>>>>>>> load a GridCoverage2D directly from the InputStream I get as a >>>>>>>>> response >>>>>>>>> to a >>>>>>>>> GetCoverage request? Just GeoTIFF would do fine for now, but I can >>>>>>>>> only >>>>>>>>> find how to load one from a file, not directly from an InputStream. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Jon >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Gabriel Roldan >>>>>>>> OpenGeo - http://opengeo.org >>>>>>>> Expert service straight from the developers. >>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> Crystal Reports - New Free Runtime and 30 Day Trial >>>>>>>> Check out the new simplified licensing option that enables unlimited >>>>>>>> royalty-free distribution of the report engine for externally facing >>>>>>>> server and web deployment. >>>>>>>> http://p.sf.net/sfu/businessobjects >>>>>>>> _______________________________________________ >>>>>>>> Geotools-gt2-users mailing list >>>>>>>> Geo...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> View this message in context: >>>>>>> http://n2.nabble.com/Reading-a-GeoTiff-from-an-InputStream--tp3093431p3160693.html >>>>>>> Sent from the geotools-gt2-users mailing list archive at Nabble.com. >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> _______________________________________________ >>>>>>> Geotools-gt2-users mailing list >>>>>>> Geo...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> _______________________________________________ >>>>>> Geotools-gt2-users mailing list >>>>>> Geo...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>>>> >>>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://n2.nabble.com/Reading-a-GeoTiff-from-an-InputStream--tp3093431p3162136.html >>>>> Sent from the geotools-gt2-users mailing list archive at Nabble.com. >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> Geotools-gt2-users mailing list >>>>> Geo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Geotools-gt2-users mailing list >>>> Geo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://n2.nabble.com/Reading-a-GeoTiff-from-an-InputStream--tp3093431p3181518.html >>> Sent from the geotools-gt2-users mailing list archive at Nabble.com. >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Geotools-gt2-users mailing list >>> Geo...@li... >>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Geotools-gt2-users mailing list >> Geo...@li... >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> >> > > -- > View this message in context: http://n2.nabble.com/Reading-a-GeoTiff-from-an-InputStream--tp3093431p3181688.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |