Error: [NodeId: Subset] Operator 'SubsetOp': Could not parse geometry

Hi everybody,
I started recently to use GPT in order for a user to be able to get a subset of the image only giving me a AOI copy / pasted from Wicket.
I tried to create a very simple graph to write a subset into a .dim
I am using the ‘$’ to be able to use gpt in my cmd console, but when I paste my polygon, I have an error : Error: [NodeId: Subset] Operator ‘SubsetOp’: Could not parse geometry.

Does anybody have an idea ?

Do you have an example of the xml where you’re using the $?

Hi everybody I will answer because I actually found the solution looking pretty much everywhere ! :slight_smile:
When writing “-Ppolygon=POLYGON((…))” I didnt put quotes …
The way to do it is actually : "-Ppolygon=‘POLYGON((…))’ "


Well I hope it helps if anybody has the same problem.
Cheers

1 Like

Thanks for leaving the solution. Run into the same problem!!

I experienced the same problem as you. Is the script that added $ is in coreg_ifg_computation_subset.xml?

I updated from SNAP9 to SNAP11 and tried to subset using GPT and the following error came up. Can anybody help me or did someone else had the same error?

I used the exact same xml that worked before with SNAP9.

#############

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.esa.snap.runtime.Engine (file:/C:/Program%20Files/esa-snap/snap/modules/ext/org.esa.snap.snap-core/org-esa-snap/snap-runtime.jar) to method java.lang.ClassLoader.initializePath(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.esa.snap.runtime.Engine
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
Executing processing graph
done.

Error: [NodeId: Subset] Operator ‘SubsetOp’: The geometry could not be parsed.
org.esa.snap.core.gpf.graph.GraphException: [NodeId: Subset] Operator ‘SubsetOp’: The geometry could not be parsed.
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:79)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:213)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:179)
at org.esa.snap.core.gpf.graph.GraphContext.init(GraphContext.java:98)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:83)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:94)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:58)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:127)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:115)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:573)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:402)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:60)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
Caused by: org.esa.snap.core.gpf.OperatorException: Operator ‘SubsetOp’: The geometry could not be parsed.
at org.esa.snap.core.gpf.internal.OperatorContext.injectConfiguration(OperatorContext.java:1149)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:526)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:298)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:359)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
… 37 more
Caused by: com.bc.ceres.binding.ConversionException: The geometry could not be parsed.
at org.esa.snap.core.util.converters.JtsGeometryConverter.parse(JtsGeometryConverter.java:51)
at org.esa.snap.core.util.converters.JtsGeometryConverter.parse(JtsGeometryConverter.java:35)
at com.bc.ceres.binding.dom.DefaultDomConverter$SingleValueChildConverter.convertDomToValue(DefaultDomConverter.java:399)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomChildToProperty(DefaultDomConverter.java:193)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomChildToPropertySet(DefaultDomConverter.java:182)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomToPropertySet(DefaultDomConverter.java:165)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomToValue(DefaultDomConverter.java:158)
at org.esa.snap.core.gpf.internal.OperatorContext.configureOperator(OperatorContext.java:1165)
at org.esa.snap.core.gpf.internal.OperatorContext.injectConfiguration(OperatorContext.java:1145)
… 41 more

Could you attached the graph?
Thank you

Of course! The graph is attached.

And I run gpt with the following code:

cd C:/Program Files/esa-snap/bin/ && gpt C:/Temp/s1-processingflow_GPT.xml -Pinput_sar=C:/Temp/S1A_IW_GRDH_1SDV_20240107T161018_20240107T161043_052003_0648C5_5D5C.zip -Psubset=‘POLYGON((23.51 48.20, 23.51 48.43, 23.87 48.43, 23.87 48.20, 23.51 48.20, 23.51 48.20, 23.51 48.20))’ -Poutput=C:/Temp/S1A_IW_GRDH_1SDV_20240107T161018_20240107T161043_052003_0648C5_5D5C_processed.tif

s1-processingflow_GPT.xml (6.8 KB)

Do you need anything else to have all the needed information?

In the meantime, I tried it on a different machine with a freshly installed SNAP 11 and the exact same error came up.

For the subset parameter, please replace ‘ with " and see if you still get an error:
cd C:/Program Files/esa-snap/bin/ && gpt C:/Temp/s1-processingflow_GPT.xml -Pinput_sar=C:/Temp/S1A_IW_GRDH_1SDV_20240107T161018_20240107T161043_052003_0648C5_5D5C.zip -Psubset=“POLYGON((23.51 48.20, 23.51 48.43, 23.87 48.43, 23.87 48.20, 23.51 48.20, 23.51 48.20, 23.51 48.20))” -Poutput=C:/Temp/S1A_IW_GRDH_1SDV_20240107T161018_20240107T161043_052003_0648C5_5D5C_processed.tif

1 Like

That works! Thanks a lot for this rather easy solution. :slight_smile: