Batch processing using GPT, Export Pixels (PixEx)

Hello all.
I want to export specific pixels from a S2 image . I have a shapefile with specific points that I need.
In the PixEx description it says to input a files that have geo-coordinates. But I assume, that it is not a shapefile.
So I exported attribute table with longitude and latitude of that shapefile to .txt (in the graph file it is named Ex_attrb).
I attach the .txt file with PixEx code info. PixEx.txt (900 Bytes)

And that’s the gpt line that I call and what I get:

gpt re_ide.xml -Pfile="/shared/Sentinel-2/Level_1C/S2A_OPER_PRD_MSIL1C_PDMC_20160427T183742_R136_V20160427T093037_20160427T093037.SAFE/GRANULE/S2A_OPER_MSI_L1C_TL_SGS__20160427T133230_A004423_T34UFF_N02.01/"
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.gpf.descriptor.ToolAdapterOperatorDescriptor: Adapter META-INF has been automatically converted to the new format
SEVERE: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Failed to register module Sen2Cor. Problem: org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor : org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
---- Debugging information ----
message : org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
class : [Lorg.esa.snap.core.gpf.descriptor.DefaultSourceProductDescriptor;
required-type : [Lorg.esa.snap.core.gpf.descriptor.DefaultSourceProductDescriptor;
converter-type : com.thoughtworks.xstream.converters.collections.ArrayConverter
path : /operator/sourceProductDescriptors/org.esa.snap.core.gpf.descriptor.SimpleSourceProductDescriptor
line number : 94
class[1] : org.esa.snap.core.gpf.descriptor.ToolAdapterOperatorDescriptor
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : 1.4.8

SEVERE: org.esa.s2tbx.dataio.gdal.activator.GDALDistributionInstaller: The environment variable LD_LIBRARY_PATH is not set. It must contain the current folder ‘.’.
Executing processing graph
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32634
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
No subsampling of 20.0 m product necessary to access 50 m water mask
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Checking for ‘/home/rus/.snap/auxdata/watermask/50m.zip’ …
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Found ‘50m.zip’.
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Checking for ‘/home/rus/.snap/auxdata/watermask/150m.zip’ …
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Found ‘150m.zip’.
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Checking for ‘/home/rus/.snap/auxdata/watermask/GC_water_mask.zip’ …
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Found ‘GC_water_mask.zip’.
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Checking for ‘/home/rus/.snap/auxdata/watermask/MODIS_north_water_mask.zip’ …
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Found ‘MODIS_north_water_mask.zip’.
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Checking for ‘/home/rus/.snap/auxdata/watermask/MODIS_south_water_mask.zip’ …
INFO: org.esa.snap.watermask.operator.WatermaskUtils: Found ‘MODIS_south_water_mask.zip’.
done.

Error: [NodeId: PixEx] Operator ‘PixExOp’: ‘double’ cannot be converted to a double.

Thanks for any help.

In the xml file you can remove the sources tag.

  <sources>
    <sourceProducts refid="Import-Vector"/>
  </sources>

But the error is caused by the coordinates tag.

    <coordinates>
      <coordinate>
        <name>Ex_attrb</name>
        <latitude>double</latitude>
        <longitude>double</longitude>
      </coordinate>
    </coordinates>

Replace the ‘double’ by the specific latitude/longitude values.

For specifying a file with the list of coordinates use the tag

 <coordinatesFile>file</coordinatesFile> 

and specify the path to the file.
For information about the file format please see the help in SNAP Desktop.

From the log output I guess that you are still using SNAP 5. It would be good that you update to version 6.

Hello.
Actually the reason why it was not working was that it has to be “sourceProduct refid=“Import-Vector”” and not "
"sourceProducts refid=“Import-Vector”. But it does have this “s” in the documentation.
And yes, I indeed, forgot to update snap in my virtual machine (I had it updated in my dektop pc). Thanks for noticing. :slight_smile: