What should geometry be when importing vector and using as a mask with gpt?

I created and used a graph in SNAP GUI which imported a shapefile as a vector and then used it as a mask.

I’m trying to use the same graph with gpt to do the task but the Land-Sea-Mask operator geometry field needs a value and I can’t work out what this should be.

As created in the GUI, geometry is given the value of the shapefile filename minus the file extension, but run via gpt this is not recognised.

Here below are the Import-Vector and mask operators from the graph created by the GUI.

  <node id="Import-Vector">
    <operator>Import-Vector</operator>
    <sources>
      <sourceProduct refid="Land-Sea-Mask"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <vectorFile>C:\myfiles\s1_data\masks\S1A_IW_GRDH_1SDV_20160317T060621_A85D_object_detection.shp</vectorFile>
      <separateShapes>false</separateShapes>
    </parameters>
  </node>
  <node id="Land-Sea-Mask(2)">
    <operator>Land-Sea-Mask</operator>
    <sources>
      <sourceProduct refid="Import-Vector"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <sourceBands/>
      <landMask>false</landMask>
      <useSRTM>true</useSRTM>
      <geometry>S1A_IW_GRDH_1SDV_20160317T060621_A85D_object_detection</geometry>
      <invertGeometry>true</invertGeometry>
      <shorelineExtension>0</shorelineExtension>
    </parameters>
  </node>
2 Likes

I think you are doing it correct. You can try to write the output of the Import-Vector node to BEAM-DIMAP and have a look how the vector data is named.
You are showing only a part of your graph, I see that you have two Land-Sea-Mask nodes, maybe the root of the problem is located somewhere else.

2 Likes

Your tip about writing the output of the Import-Vector node to BEAM-DIMAP was spot on.

If the imported shapefile is called /somepath/somename.shp then the geometry is called somename_1

I can now use the graph from the command line and pass gpt the correct geometry name.

Thanks.

1 Like