Error in graph builder for subset image through a shape file

I can subset the image using a shape file successfully when I do it manually using Land-Mask operator. I want to do automation for so many files so i tried to generate a graph for it but it showing an error.


Then I change the source of the import vector.

But the problem is i am not getting my shapefile in the dropdown menu. Also, I tried to edit the xml files manually by giving the shape file. i exucted the xml file from snap command line and its showin 90% done and an error message.

gpt E:\Try\SubsetS1c1.xml -t E:\Try\S1A_IW_SLC__1SDV_20150727T003129_20150727T003158_006989_0097BF_B5BA_Subset.dim E:\Try\S1A_IW_SLC__1SDV_20150727T003129_20150727T003158_006989_0097BF_B5BA.dim
INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘S2RutOp’ registered (Python module: ‘s2_rut’, class: ‘S2RutOp’, root: ‘C:\Users\SAIPLANNER\AppData\Roaming\SNAP\modules\org-esa-snap-snap-rut.jar’)
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
90% done.
org.esa.snap.core.gpf.OperatorException
at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:363)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
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.util.RequestJob.compute(SunTileScheduler.java:247)
at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: java.lang.NullPointerException
at org.esa.snap.core.jexp.TermTransformer.apply(TermTransformer.java:16)
at org.esa.snap.core.jexp.AbstractTermTransformer.visit(AbstractTermTransformer.java:49)
at org.esa.snap.core.jexp.AbstractTermTransformer.visit(AbstractTermTransformer.java:9)
at org.esa.snap.core.jexp.Term$Cond.accept(Term.java:1118)
at org.esa.snap.core.jexp.TermTransformer.apply(TermTransformer.java:16)
at org.esa.snap.core.image.VirtualBandOpImage.computeTile(VirtualBandOpImage.java:230)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
… 11 more

Error: org.esa.snap.core.gpf.OperatorException<a class=“attachment”

href="/uploads/default/original/2X/9/9bdba23d2a3f19746168768872e9e53b6d8543af.xml">SubsetS1c1.xml (2.7 KB)

SubsetS1c1.xml (2.7 KB)

It is possible that the combination of Land-Sea-Mask and ImportVector is not working well in the GUI.

Use the graph you have created in the CLI and change the geometry tag of Land-Sea-Mask operator to

<geometry>CMA</geometry>

I guess it is named CMA like the file name. Just try to import the file in the Desktop and see how it is named in the vector data section of the product.

Dear marpet,
I have changed the xml to CMA. I recieved the following error.

gpt E:\Try\XML\SubsetS1c1.xml
INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘S2RutOp’ registered (Python module: ‘s2_rut’, class: ‘S2RutOp’, root: ‘C:\Users\SAIPLANNER\AppData\Roaming\SNAP\modules\org-esa-snap-snap-rut.jar’)
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
expression: Undefined symbol ‘CMA’. due to Undefined symbol ‘CMA’.
done.

Error: [NodeId: Land-Sea-Mask] expression: Undefined symbol ‘CMA’. due to Undefined symbol ‘CMA’.

Then it is named differently.
Import the shapefile by using the VectorOperator in the Graph Builder (just on your subset) and see how it is named.

Hi,

I am getting a similar error when trying to import a shapefile to be used as a mask to subset the image. I define the path of the shp in the impor-vector and then, it is not visible in the Land-Sea-Mask operator.

Is this the correct way to perform the analysis or am I missing something?

M

I just solved it. Kind of easy so I will post the answer in case someone is reading this later. When building the graph you have to follow the same logic as when doing the analysis step by step. In that case, you would select the product where you want to import the shp and then use the import vector operator to do the job. Well, my error was that my import vector operator was not linked to any Sentinel product.

I think the error message creates some confusion. By saying “source product not set” it seems we are not setting the path to the shp, but it is actually referring to the Sentinel product.

Anyways, one image is better than a thousand words

M

8 Likes