Hello again, sorry for the long time without response.

I checked with the isJaiExtEnabled() Method from the ImageWorker and
JAI-EXT is definitely enabled.
I tried using different WMS and it was the same error for all of them. (
https://sgx.geodatenzentrum.de/wms_clc5_2018 and
http://ows.mundialis.de/services/service? and another one i don't remember)
I also tried the same using the swing module and the same error was thrown.
I know that the swt module is a port of the swing module. So either this
problem is there for quite some time and was ported over from swing, so now
both have it. Or another module is responsible.

I saw the post on the user mailing list. By only using the code from the
image tutorial, the same error occurs.
I did modify the WMSCoverageReader section pointed out there, such that the
read(GeneralParameterValue[] parameters) method always calls getMap instead
of using the grid that is already there and now everything works fine.
But of course this is no solution, as it just bypasses the caching
mechanism for the grid. As already pointed out in this message, this
"theImage" field within the renderedImage is somehow set to null, after the
initial display of the map and i have no idea why that would happen.

You can see the debugger view of the grid in the enclosed picture. Left
side is right after the code to import the wms was run, everything ok
there. Right side right after toggling visibility, "theImage" is now null.
So somehow this grid is stored wrong, such that data loss occurs.
Reproduction of the error is to just use the WMSLab code from the
imagetutorial or use the swtmappane to display a wms. Then press zoom
extent button twice or toggle layer visibility.
Any idea why the grid loses the image within and where to look at for a fix?

Jones

Am Fr., 10. Juli 2020 um 07:40 Uhr schrieb Jody Garnett <
jody.garn...@gmail.com>:

> Thanks for joining on the developer list to look into this issue, given
> that the bug is still open if someone already solved this problem they did
> not share the solution with the geotools project.
>
> JAI provides the image processing API, JAI-EXT extends this with
> operations that are better suited for GIS data (respecting things like
> nodata in your example).  ImageIO is an image format library, with
> ImageIO-EXT providing access to additional GIS image formats such as
> GeoTIFF.
>
> Ideas:
> - Double check you called the appropriate JAIExt.initJAIEXT(); method to
> set everything up? As per tutorial
> <https://docs.geotools.org/latest/userguide/tutorial/raster/jaiext.html>.
> - If you use the swing tutorial can you access the same image file? I
> would like to confirm that this is a specific failure to SWT (rather than
> an issue with the test image you are using).
> - Please step through the debugger with the normal swing app to see how
> ImageWorker expects to operate, compare how this operates when used in your
> SWT operation
>
> The uDig program (which uses SWT) has recently upgraded their version of
> GeoTools so what you are trying should work.
> --
> Jody Garnett
>
>
> On Fri, 3 Jul 2020 at 07:38, Jonas Schrottenbaum via GeoTools-Devel <
> geotools-devel@lists.sourceforge.net> wrote:
>
>> Hello,
>>
>> currently i'm working on my E4 RCP application with the GeoTools
>> repository completely cloned and in my workspace. So i'm using the most
>> recent version of the SWT module (24-snapshot, where no official release is
>> out as far as i know). And i ran into a bug that some others
>> apparently also had in the past. See here:
>> https://osgeo-org.atlassian.net/browse/GEOT-6277?attachmentOrder=asc and
>> https://sourceforge.net/p/geotools/mailman/message/36741424/
>>
>> I can add the swtMapPane into a part. Loading shapefiles works fine
>> without problems. I also can load a WMS. But as soon as i toggle the
>> visibility in the layer view, or use the zoom extent option twice in a row,
>> i get the same error as in the links above.
>>
>> Did someone solve this problem already? Or is it still unknown, why it
>> happens?
>>
>> I'm aiming for a contribution later that year, for the swt module. Any
>> suggestions, what in this module causes the error, so i can have a look at
>> it and hopefully fix it?
>>
>> First thing i want to try is using JAI EXT (or should i use ImageIO EXT
>> instead?). Do i need to turn it on in my own code, or in the swt module
>> code?
>> Any other ideas where to look at and what to try?
>>
>> Thanks in advance,
>> Jones
>> _______________________________________________
>> GeoTools-Devel mailing list
>> GeoTools-Devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to