PixelGeoCoding not correctly working if product width or height is <= 2 pixels
Description
The PixelGeoCoding is not correctly working if product width or height is <= 2 pixels, such as the attached product (width=2) . Obviously this is caused by the method setEpsilon(), introduced on Nov 22nd, 2019, which seems to require a width/height of at least 3 pixels in the current implementation.
java.lang.IllegalArgumentException: The specified region, if not null, must intersect with the image`s bounds.
at javax.media.jai.PlanarImage.getData(Unknown Source)
at org.esa.snap.core.datamodel.PixelGeoCoding.getGeoPosInternal(PixelGeoCoding.java:1034)
at org.esa.snap.core.datamodel.PixelGeoCoding.setEpsilon(PixelGeoCoding.java:457)
at org.esa.snap.core.datamodel.PixelGeoCoding.initialize(PixelGeoCoding.java:807)
at org.esa.snap.core.datamodel.PixelGeoCoding.getGeoPos(PixelGeoCoding.java:825)
at org.esa.snap.core.util.ProductUtils.createGeoBoundary(ProductUtils.java:519)
at org.esa.snap.core.util.ProductUtils.createGeoBoundaryPaths(ProductUtils.java:652)
at org.esa.snap.core.util.ProductUtils.createGeoBoundaryPaths(ProductUtils.java:621)
at org.esa.snap.worldwind.layers.DefaultProductLayer.addOutline(DefaultProductLayer.java:224)
at org.esa.snap.worldwind.layers.DefaultProductLayer.addProduct(DefaultProductLayer.java:164)
at org.esa.snap.worldwind.WWBaseToolView.lambda$setProducts$3(WWBaseToolView.java:117)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.esa.snap.worldwind.WWBaseToolView.setProducts(WWBaseToolView.java:113)
at org.esa.snap.worldwind.WWProductManagerListener.productAdded(WWProductManagerListener.java:36)
at org.esa.snap.core.datamodel.ProductManager.fireEvent(ProductManager.java:310)
at org.esa.snap.core.datamodel.ProductManager.fireEvent(ProductManager.java:302)
at org.esa.snap.core.datamodel.ProductManager.addProduct(ProductManager.java:170)
at org.esa.snap.rcp.actions.file.ReadProductOperation.lambda$run$1(ReadProductOperation.java:63)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
The PixelGeoCoding is not correctly working if product width or height is <= 2 pixels, such as the attached product (width=2) . Obviously this is caused by the method setEpsilon(), introduced on Nov 22nd, 2019, which seems to require a width/height of at least 3 pixels in the current implementation.
java.lang.IllegalArgumentException: The specified region, if not null, must intersect with the image`s bounds. at javax.media.jai.PlanarImage.getData(Unknown Source) at org.esa.snap.core.datamodel.PixelGeoCoding.getGeoPosInternal(PixelGeoCoding.java:1034) at org.esa.snap.core.datamodel.PixelGeoCoding.setEpsilon(PixelGeoCoding.java:457) at org.esa.snap.core.datamodel.PixelGeoCoding.initialize(PixelGeoCoding.java:807) at org.esa.snap.core.datamodel.PixelGeoCoding.getGeoPos(PixelGeoCoding.java:825) at org.esa.snap.core.util.ProductUtils.createGeoBoundary(ProductUtils.java:519) at org.esa.snap.core.util.ProductUtils.createGeoBoundaryPaths(ProductUtils.java:652) at org.esa.snap.core.util.ProductUtils.createGeoBoundaryPaths(ProductUtils.java:621) at org.esa.snap.worldwind.layers.DefaultProductLayer.addOutline(DefaultProductLayer.java:224) at org.esa.snap.worldwind.layers.DefaultProductLayer.addProduct(DefaultProductLayer.java:164) at org.esa.snap.worldwind.WWBaseToolView.lambda$setProducts$3(WWBaseToolView.java:117) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at org.esa.snap.worldwind.WWBaseToolView.setProducts(WWBaseToolView.java:113) at org.esa.snap.worldwind.WWProductManagerListener.productAdded(WWProductManagerListener.java:36) at org.esa.snap.core.datamodel.ProductManager.fireEvent(ProductManager.java:310) at org.esa.snap.core.datamodel.ProductManager.fireEvent(ProductManager.java:302) at org.esa.snap.core.datamodel.ProductManager.addProduct(ProductManager.java:170) at org.esa.snap.rcp.actions.file.ReadProductOperation.lambda$run$1(ReadProductOperation.java:63) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)