Interesting, a couple ideas since you are updating from an older version...
The stack trace seems to fail when checking for no-data (see line about
"org.geotools.image.ImageWorker.extractNoDataProperty(ImageWorker.java:547)"

- If you are using a local raster - does you image use transparency or a
no-data mask? Can you try it without transparency?
- You did not really say what your application was using for data, based on
the URL should I assume you are using a WMS layer?


In addition to the built-in JAI operations GeoTools has the option to use
the replacement JAI-EXT operations which do a better job of handling
transparency and no data (see JAI-EXT tutorial
<https://docs.geotools.org/stable/userguide/tutorial/raster/jaiext.html>).
You can try it out by adding JAIExt.initJAIEXT() to your program...

--
Jody Garnett


On Thu, 15 Aug 2019 at 01:10, Ludwig Moser-Spitzenstätter <luke2...@gmx.at>
wrote:

> Hello guys,
>
> i tried extending the javafx example you have online (actually migrating
> a map i implemented in SWT)
> i noticed that this version of your example uses GT 14.3, which is
> pretty old - so i tried to upgrade to 21.2
> which resulted in some errors (packages changed etc...)
> after some struggling, i decided to go back to 14.3 to see if i fucked
> the app up by my changes. (also tried 14.4)
>
> maven reported me that version 21.2 is corrupted (check failed) so i
> deleted it from my m2. repo manually.
>
> i fixed the errors and launched my modified version - all fine and
> working as expected.
> this was followed by my second attempt to switch to GT 21.2. This time
> with success.
>
> BUT: no more build errors, but i get the following NullPointerException
> logged to the console
>
> Notice, that the link written to the console is accessible via
> browser... but the image is NOT shown in the application anymore!
> i do not know where this EXception gets raised, as the stack does not
> list any of my Classes..
>
> anyone noticed this exception and has a fix for it?
>
> Layer: OpenStreetMap WMS
> Layer: OpenStreetMap WMS - by terrestris
> Layer bounds: GeneralEnvelope[(-180.0, -88.0), (180.0, 88.0)]
>
> http://ows.terrestris.de/osm/service?SERVICE=WMS&LAYERS=OSM-WMS&CRS=EPSG:4326&FORMAT=image%2Fpng&HEIGHT=600&TRANSPARENT=TRUE&REQUEST=GetMap&WIDTH=800&BBOX=31.0,-22.0,67.0,50.0&STYLES=&VERSION=1.3.0
>
> 2019-08-15T09:49:05.447+0200  WARNING  null
> java.lang.NullPointerException
>      at
>
> javax.media.jai.RenderedImageAdapter.getProperty(RenderedImageAdapter.java:189)
>      at
> org.geotools.image.ImageWorker.extractNoDataProperty(ImageWorker.java:547)
>      at org.geotools.image.ImageWorker.setImage(ImageWorker.java:566)
>      at org.geotools.image.ImageWorker.<init>(ImageWorker.java:505)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.affine(GridCoverageRenderer.java:673)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.symbolize(GridCoverageRenderer.java:455)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:1018)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:1234)
>      at
>
> org.geotools.renderer.lite.StreamingRenderer$RenderCoverageReaderRequest.execute(StreamingRenderer.java:3822)
>      at
>
> org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3916)
>      at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>      at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>      at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>      at java.lang.Thread.run(Thread.java:745)
>
> 2019-08-15T09:49:05.448+0200  SEVERE  null
> java.lang.NullPointerException
>      at
>
> javax.media.jai.RenderedImageAdapter.getProperty(RenderedImageAdapter.java:189)
>      at
> org.geotools.image.ImageWorker.extractNoDataProperty(ImageWorker.java:547)
>      at org.geotools.image.ImageWorker.setImage(ImageWorker.java:566)
>      at org.geotools.image.ImageWorker.<init>(ImageWorker.java:505)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.affine(GridCoverageRenderer.java:673)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.symbolize(GridCoverageRenderer.java:455)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:1018)
>      at
>
> org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:1234)
>      at
>
> org.geotools.renderer.lite.StreamingRenderer$RenderCoverageReaderRequest.execute(StreamingRenderer.java:3822)
>      at
>
> org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3916)
>      at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>      at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>      at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>      at java.lang.Thread.run(Thread.java:745)
>
>
>
> ---
> Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
> https://www.avast.com/antivirus
>
>
>
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to