[geotk] applet to display raster

Ramzi Oueslati geotoolkit.org at oueslati.org
Wed Jan 12 10:00:42 EST 2011


Martin,

Well well. It seems it did the trick. I don't understand why but it
seems classes are only loaded when explicitly called from the code. I
will try to find out.
It still does not work but now I get the same exception as when I try
to display a JPEG image:

org.opengis.referencing.operation.TransformException: Can't transform envelope.
	at org.geotoolkit.referencing.CRS.transform(CRS.java:1456)
	at org.geotoolkit.display.primitive.AbstractReferencedGraphic2D.setEnvelope(AbstractReferencedGraphic2D.java:174)
	at org.geotoolkit.display2d.container.stateless.AbstractLayerJ2D.<init>(AbstractLayerJ2D.java:70)
	at org.geotoolkit.display2d.container.statefull.StatefullCoverageLayerJ2D.<init>(StatefullCoverageLayerJ2D.java:65)
	at org.geotoolkit.display2d.container.stateless.StatelessContextJ2D.parseLayer(StatelessContextJ2D.java:127)
	at org.geotoolkit.display2d.container.stateless.StatelessContextJ2D.layerChange(StatelessContextJ2D.java:200)
	at org.geotoolkit.map.ContextListener$Weak.layerChange(ContextListener.java:100)
	at org.geotoolkit.map.DefaultMapContext.fireLayerChange(DefaultMapContext.java:231)
	at org.geotoolkit.map.DefaultMapContext$AdapterList.add(DefaultMapContext.java:390)
	at org.geotoolkit.map.DefaultMapContext$AdapterList.add(DefaultMapContext.java:360)
	at java.util.AbstractList.add(Unknown Source)
	at com.spotimage.sdi.applet.OOApplet$1.actionPerformed(OOApplet.java:97)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: org.opengis.referencing.operation.OperationNotFoundException:
No transformation available from system "ImageCRS[Grid]" to
"GeographicCRS[WGS84(DD)]".
	at org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:339)
	at org.geotoolkit.referencing.CRS.transform(CRS.java:1454)
	... 35 more

No problem from appletviewer though.

Regards,
Ramzi Oueslati

2011/1/12 Martin Desruisseaux <martin.desruisseaux at geomatys.fr>:
> Hello Ramzi
>
> Le 12/01/11 13:05, Ramzi Oueslati a écrit :
>>
>> org.geotoolkit.image.io.plugin.GeoTiffImageReader$TIFF
>> org.geotoolkit.image.io.plugin.WorldFileImageReader$TIFF
>> com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderSpi
>> com.sun.media.imageioimpl.plugins.pnm.PNMImageReaderSpi
>> com.sun.media.imageioimpl.plugins.raw.RawImageReaderSpi
>> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi
>> com.sun.media.imageioimpl.plugins.wbmp.WBMPImageReaderSpi
>> com.sun.media.imageioimpl.plugins.bmp.BMPImageReaderSpi
>
> The two Geotk ones are missing because they depend on a "plain" TIFF reader,
> and none were found.
>
>> IIORegistry.getDefaultInstance().registerServiceProvider(new
>> GeoTiffImageReader.Spi("TIFF"), ImageReaderSpi.class);
>> No problem at all when the applet runs from the appletviewer. However,
>> within the web browser it says:
>>
>> java.lang.IllegalArgumentException: Image format "TIFF" is unknown.
>
> Yes, again this is because the JAI TIFF image reader is not registered. I
> suggest to try the following line first:
>
> IIORegistry.getDefaultInstance().registerServiceProvider(new
> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi(),
> ImageReaderSpi.class);
>
> As a side effect, if there is a problem with the classpath (i.e. if
> jai_imageio-1.1.jar is not loaded for whatever reason), we should have a
> ClassNotFoundError now...
>
>    Martin
>
> _______________________________________________
> Geotoolkit mailing list
> Geotoolkit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geotoolkit
>


More information about the Geotoolkit mailing list