Unable to use the Polygon drawing tool

Hi,

I’m trying to draw a polygon on top of a DIMAP image that was produced by a segmentation algorithm, to delineate the part of the image that was extracted by this algorithm.

But, I’m not even able to draw the polygon using the Polygon drawing tool (see the image below about the tool I’m struggling with), even thought the line and rectangle tools are working correctly?

I don’t think this issue is related to Creating mask from polygon, since there’s only one band in this product.

Should I create a mask or a layer before trying to draw the polygon (I’m actually unfamiliar with both of these tools)?

Hakim.

It’s not quite clear to me what you are struggling with. You first click the highlighted tool (or first “create vector container” two icons left of it). “geometry” should be displayed now within the vectors of your product. This geometry can then be filled with digitized lines.

If you want to use an already existing shapefile you will have to select file > imoport > vector > shapefile.

I can’t imagine any reason why the polygon tool behaves differently to the other drawing tools. What about the polyline tool, is this working?
It is not necessary to create a mask or layer beforehand. It will be created if necessary.
After you have observed the error can you go to Help / Show Log Directory and attach the messages.log file here.

I can’t reproduce the issue I’m having with the polygon drawing tool all the time. Sometimes it works correctly, but when it’s not working even if I select the tool and try to draw nothing appears on the image.

I’ve noticed an error on the bottom toolbar:

java.lang.NullPointerException
at org.esa.snap.ui.product.VectorDataLayer$FigureChangeHandler.figureChanged(VectorDataLayer.java:212)
at com.bc.ceres.swing.figure.AbstractFigure.fireFigureChanged(AbstractFigure.java:440)
at com.bc.ceres.swing.figure.support.DefaultFigureCollection.access$300(DefaultFigureCollection.java:30)
at com.bc.ceres.swing.figure.support.DefaultFigureCollection$ChangeDelegate.figureChanged(DefaultFigureCollection.java:309)
at com.bc.ceres.swing.figure.AbstractFigure.fireFigureChanged(AbstractFigure.java:440)
at com.bc.ceres.swing.figure.AbstractFigure.fireFigureChanged(AbstractFigure.java:433)
at org.esa.snap.ui.product.SimpleFeatureShapeFigure.setShape(SimpleFeatureShapeFigure.java:125)
at com.bc.ceres.swing.figure.interactions.InsertMultiPointFigureInteractor.mouseMoved(InsertMultiPointFigureInteractor.java:148)
at com.bc.ceres.swing.figure.InteractionDispatcher.mouseMoved(InteractionDispatcher.java:76)
at java.awt.AWTEventMulticaster.mouseMoved(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(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.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
[catch] at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
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)

Please see the attached file: messages.log (104.7 KB)

This definitely looks like a programming error. We have to look at it.
I have noted it (SNAP-739).

1 Like