Hi Michael,
you are right. I didn't see it.
Sextante raster uses a separate way to calculate image dimension,  while
class com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster
is used only for the image.
Possibly the proble could be in the class AddRasterImageLayerWizard. I will
give a look.
Peppe

Il giorno dom 13 set 2020 alle ore 13:14 Michaud Michael <
m.michael.mich...@orange.fr> ha scritto:

> Hi Peppe,
>
> Your experiment just prove that Sextant Raster reader read geotif tag and
> world file in a consistant way (whic is not so bad ;-), but not that it
> displays the image with the right coordinates.
>
> If I read the metadata (either geotiff tags or tfw), the image is 3601 x
> 3601 pixels with a pixel size of  2.77777777777779E-4, it means it should
> be about 1.0 degree wide.
>
> If I read the image with the ImageIO[ext], jai reader, it is actually
> about 1.0 wide, but with Sextant Raster reader it is only  0.0126 wide
> (note that the upper left corner is correct)
>
> What do you think ?
>
> Michaël
>
> *envoyé :* 13 septembre 2020 à 11:55
> *de :* Giuseppe Aruta <giuseppe.ar...@gmail.com>
> *à :* "[jump-pilot:bugs]" <4...@bugs.jump-pilot.p.re.sourceforge.net>,
> OpenJump develop and use <jump-pilot-devel@lists.sourceforge.net>
> *objet :* Re: [JPP-Devel] [jump-pilot:bugs] #498 Most GeoTIFF drivers
> fail with a simple GeoTIFF image
>
> Actually Image Raster (Sextante) uses class
> com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster to
> read an image.
>
> @Michael ASTGTMV003_N08W084_de file is a geotiff  even it has a tfw file:
> everythimes that OJ loads a till image,  even geotiff,  it creates a new
> worldfile
>
> I made this test:
> a) load ASTGTMV003_N08W084_dem with tfw on the view as Sextante
> b) create its envelope (via tool on Layer tree). This gives me the right
> position of the image. Remember that everytimes that a TIFF image, even
> geotiff, is loaded as SExtante a new worldfile is created
> c) remove ASTGTMV003_N08W084_dem from the view
> d) delate ASTGTMV003_N08W084_dem worldfile
> e) reload ASTGTMV003_N08W084_dem and verify that it has a  correct
> position into the envelope
>
> Using the other image loaded,
> all fails to load either they don't find tags (even if they are embedded
> into the file) or they cannot read a worldfile
>
> Il giorno dom 13 set 2020 alle ore 11:35 michael michaud via
> Jump-pilot-devel <jump-pilot-devel@lists.sourceforge.net> ha scritto:
>
> I did mor eextensive tests with 4 types of image :
> *small world* : seems that the problem with commons-imaging is the
> combination of multi-bands and interleave=band (an image with same
> characteristics but with interleave=pixel can be read correctly)
> *peppe's dem (ASTGTMV003_N08W084_dem)* : this is a int16 monoband raster.
> I found two kind of problems : some readers fail with an IAE beacuse of the
> absence of ColorModel (JAI TIFF and JAI XTIFF). Other have problems with
> geotags : if I remove tfw, JAI Tiff Reader (v1.4.0) can georeference th
> eimage, Sextant Raster reader read the image with good position (upper left
> corner) but a wrong size, GeoTIFF PLUS does not find geotags. Commons
> imaging read the image without georeferencement (image coordinates), and
> image is black.
> *peppe's geotiff* : this is a float32 monoband raster. I could only read
> it with Sextant Raster and with Commons Imaging (strange psychedelic
> apperance with Commons Imaging though). Other readers through exception
> (IOOBE) while reading, not while loading. No stacktrace in the log file
> about the error.
> Attached, an document with the characteristics of each image and the
> success/failure with each driver.
>
> Attachments:
>
>    - image_readers.ods
>    
> <https://sourceforge.net/p/jump-pilot/bugs/_discuss/thread/e45ff882e3/724f/attachment/image_readers.ods>
>    (14.0 kB; application/vnd.oasis.opendocument.spreadsheet)
>
> ------------------------------
>
> * [bugs:#498] <https://sourceforge.net/p/jump-pilot/bugs/498/> Most
> GeoTIFF drivers fail with a simple GeoTIFF image*
>
> *Status:* open
> *Milestone:* OJ_future
> *Created:* Sun Aug 30, 2020 08:02 AM UTC by michael michaud
> *Last Updated:* Sat Sep 12, 2020 02:15 PM UTC
> *Owner:* nobody
> *Attachments:*
>
>    - small_world.tif
>    <https://sourceforge.net/p/jump-pilot/bugs/498/attachment/small_world.tif>
>    (240.6 kB; image/tiff)
>
> I often have a bad experience trying to read simple geotiff. To have a
> more objective view of the situation, I get a very simple image from the
> test directory of GDAL library and tested it against all our drivers.
> Image is attached. Here are its main characteristics (I think they are
> very common one) :
> small_world.tif
> size : 400 x 200
> Coordinate System : wgs84 (4326)
> Metadata : AREA_OR_POINT=AREA
> Image Structure Metadata : INTERLEAVE=BAND
> 3 bands, Block=400x20, Type=Byte, ColorInterp=RGB
>
> I tried to import it with all the image drivers we propose (8 from Open
> File + ImageRaster Sextante). 3 drivers only could import the image. All
> others fail throughing a rough java exception. Image Raster don't fail
> immediately, but it does not display the image and throws NPE if one try to
> get more information.
>
> List of success/failures and exceptions thrown
>
> Referenced Image (ImageIO[ext],JAI) : OK
> ImageIO TIFF Image Reader version 1.0 : OK
> ImageIO TIFF Image Reader version 1.1 : OK
> Standard TIFF Image Reader
> java.lang.IllegalAccessException: class
> com.vividsolutions.jump.workbench.imagery.ImageryLayerDataset cannot access
> class com.sun.imageio.plugins.tiff.TIFFImageReaderSpi (in module
> java.desktop) because module java.desktop does not export
> com.sun.imageio.plugins.tiff to unnamed module @12405818
> at
> java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
> at
> java.base/jdk.internal.reflect.Reflection.ensureMemberAccess(Reflection.java:99)
> at java.base/java.lang.Class.newInstance(Class.java:579)
> at
> com.vividsolutions.jump.workbench.imagery.ImageryLayerDataset.createFeatureFactory(ImageryLayerDataset.java:236)
> at
> com.vividsolutions.jump.workbench.imagery.ImageryLayerDataset.attachImage(ImageryLayerDataset.java:117)
> Referenced Image (JAI TIF)
> java.lang.NullPointerException java.lang.NullPointerException at
> com.sun.media.jai.util.SunCachedTile.<init>(SunCachedTile.java:80)
> at com.sun.media.jai.util.SunTileCache.add(SunTileCache.java:257)
> at javax.media.jai.OpImage.addTileToCache(OpImage.java:1087)
> at javax.media.jai.OpImage.getTile(OpImage.java:1142)
> at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
> at
> javax.media.jai.RenderedImageAdapter.getData(RenderedImageAdapter.java:158)
> at javax.media.jai.ScaleOpImage.computeTile(ScaleOpImage.java:1099)
> at
> com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
>
> at javax.media.jai.OpImage.getTile(OpImage.java:1129)
> at com.sun.media.jai.opimage.CropOpImage.getTile(CropOpImage.java:122)
> at
> com.sun.media.jai.opimage.TranslateIntOpImage.getTile(TranslateIntOpImage.java:132)
> at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343)
> at javax.media.jai.RenderedOp.copyData(RenderedOp.java:2299)
> at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2525)
> at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2546)
> at
> com.vividsolutions.jump.workbench.imagery.geoimg.GeoImage.paint(GeoImage.java:285)
>
> at
> com.vividsolutions.jump.workbench.imagery.ReferencedImageStyle.paint(ReferencedImageStyle.java:61)
> Referenced Image (JAI TIF) : same error</init>
>
> Buffered Image (common) :
> com.vividsolutions.jump.workbench.imagery.ReferencedImageException:
> java.lang.ArrayIndexOutOfBoundsException: Index 8000 out of bounds for
> length 8000
> at
> com.vividsolutions.jump.workbench.imagery.graphic.CommonsImage.initImage(CommonsImage.java:112)
> at
> com.vividsolutions.jump.workbench.imagery.graphic.AbstractGraphicImage.computeEnvelope(AbstractGraphicImage.java:122)
> at
> com.vividsolutions.jump.workbench.imagery.graphic.AbstractGraphicImage.getEnvelope(AbstractGraphicImage.java:114)
> at
> com.vividsolutions.jump.workbench.imagery.ImageryLayerDataset.attachImage(ImageryLayerDataset.java:125)
> at
> com.vividsolutions.jump.workbench.imagery.ImageryLayerDataset.attachImage(ImageryLayerDataset.java:106)
> at
> com.vividsolutions.jump.workbench.imagery.ReferencedImageFactoryFileLayerLoader.createImageFeature(ReferencedImageFactoryFileLayerLoader.java:199)
> at
> com.vividsolutions.jump.workbench.imagery.ReferencedImageFactoryFileLayerLoader.open(ReferencedImageFactoryFileLayerLoader.java:102)
> at
> org.openjump.core.ui.plugin.file.open.OpenFileWizard.run(OpenFileWizard.java:164)
> GeoTIFF plus (JAI) :
> java.lang.NullPointerException java.lang.NullPointerException at
> com.sun.media.jai.util.SunCachedTile.<init>(SunCachedTile.java:80)
> at com.sun.media.jai.util.SunTileCache.add(SunTileCache.java:257)
> at javax.media.jai.OpImage.addTileToCache(OpImage.java:1087)
> at javax.media.jai.OpImage.getTile(OpImage.java:1142)
> at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
> at
> javax.media.jai.RenderedImageAdapter.getData(RenderedImageAdapter.java:158)
> at javax.media.jai.ScaleOpImage.computeTile(ScaleOpImage.java:1099)
> at
> com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
>
> at javax.media.jai.OpImage.getTile(OpImage.java:1129)
> at com.sun.media.jai.opimage.CropOpImage.getTile(CropOpImage.java:122)
> at
> com.sun.media.jai.opimage.TranslateIntOpImage.getTile(TranslateIntOpImage.java:132)
> at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343)
> at javax.media.jai.RenderedOp.copyData(RenderedOp.java:2299)
> at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2525)
> at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2546)
> at
> com.vividsolutions.jump.workbench.imagery.geoimg.GeoImage.paint(GeoImage.java:285)
>
> at
> com.vividsolutions.jump.workbench.imagery.ReferencedImageStyle.paint(ReferencedImageStyle.java:61)</init>
>
> Image Raster (Sextante) : no exception but does not display
> NPE Exception comes if one click on layer properties
> java.lang.NullPointerException
> at com.sun.media.jai.util.SunCachedTile.<init>(SunCachedTile.java:80)
> at com.sun.media.jai.util.SunTileCache.add(SunTileCache.java:257)
> at javax.media.jai.OpImage.addTileToCache(OpImage.java:1087)
> at javax.media.jai.OpImage.getTile(OpImage.java:1142)
> at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343)
> at
> javax.media.jai.RenderedImageAdapter.copyData(RenderedImageAdapter.java:163)
> at javax.media.jai.RenderedOp.copyData(RenderedOp.java:2299)
> at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2525)
> at
> org.openjump.core.rasterimage.RasterImageIO.loadRasterData(RasterImageIO.java:202)
> at
> org.openjump.core.rasterimage.RasterImageLayer.getRasterData(RasterImageLayer.java:1505)
> at
> org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.setInfo(RasterImageLayerPropertiesPlugIn.java:444)
> at
> org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.infoText(RasterImageLayerPropertiesPlugIn.java:248)
> at
> org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.execute(RasterImageLayerPropertiesPlugIn.java:363)
> </init>
> ------------------------------
>
> Sent from sourceforge.net because jump-pilot-devel@lists.sourceforge.net
> is subscribed to https://sourceforge.net/p/jump-pilot/bugs/
>
> To unsubscribe from further messages, a project admin can change settings
> at https://sourceforge.net/p/jump-pilot/admin/bugs/options. Or, if this
> is a mailing list, you can unsubscribe from the mailing list.
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to