GPT xml files resampling: files for batch processing

Thankyou in advance for reading:

I created an xml file just for Resampling, in the via graph builder of SNAP, with the aim of using from cmd line with gpt.

Following suggestions from another opened issue
(Doesn't take specified source in gpt),
I removed the read and write nodes, so that input and output files could be defined in the command line.

However when calling from cmd:
gpt.exe C:/Users/Ut1/Prova_SNAP_Graph_Builder/Resample.xml -t ‘C:/Users/Ut1/Prova_SNAP_Graph_Builder/LAI_Cab_GeoTiff/provaXML/LAI_Agabiti.TIF’ ‘C:/Users/Ut1/Recent images/S2A_MSIL2A_20190213T101131_N0211_R022_T32TQN_20190213T162253.SAFE/MTD_MSIL2A.xml’

An error occurs. It seems gpt looks for a file that is not available within the products. But the process was working fine when lunched from within SNAP:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32632
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
INFO: org.hsqldb.persist.Logger: dataFileCache open start
WARNING: org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader: Warning: missing file C:\Users\Ut1\Recent images\S2A_MSIL2A_20190213T101131_N0211_R022_T32TQN_20190213T162253.SAFE\GRANULE\L2A_T32TQN_A019038_20190213T101610\QI_DATA\L2A_T32TQN_20190213T101131_DDV_20m.jp2

WARNING: org.esa.s2tbx.dataio.s2.ortho.Sentinel2OrthoProductReader: Warning: no image files found for band quality_dense_dark_vegetation

done.

Error: [NodeId: Resample] Operator ‘ResamplingOp’: Mandatory source product (field ‘sourceProduct’) not set.

Any guesses?

Thank you!
Resample.xml (571 Bytes)

The missing file is just a warning you don’t see in the desktop application.
You need to rename the tag source to sourceProduct.
I’ve updated the xml file.
Resample.xml (585 Bytes)

Thank you!

however, I updated the .xml, as you suggested, and then I run in:
Error: Output format unknown

the end result that I am trying to obtain is a more complex workflow (attachment), with which I obtain anyway the same error: Resample_Subset_Reproject_Bioph_i3.xml (3.0 KB)

C:\Program Files\snap\bin>gpt.exe C:/Users/Ut1/Prova_SNAP_Graph_Builder/Resample_Subset_Reproject_Bioph_i3 -t ‘C:/Users/Ut1/Prova_SNAP_Graph_Builder/LAI_Cab_GeoTiff/provaXML/LAI_Agabiti.tif’ ‘C:/Users/Ut1/Recent images/S2A_MSIL2A_20190213T101131_N0211_R022_T32TQN_20190213T162253.SAFE/MTD_MSIL2A.xml’
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters

Error: Output format unknown

I think the problem is related to the single quotes.
I guess you have used single quotes which are not allowed on the command line.
You can replace them by double quotes.
I guess the file extension is not correctly extracted and therefor the format can not be detected.

Allowed quotes are: " and ’
not allowed: ` and ´

Thanks a lot!

It does what it should!

…after adding also the “version” into the “.xml” file, and the “.xml” extension in the cmd call :slight_smile:

gpt.exe C:/Users/Ut1/Prova_SNAP_Graph_Builder/Resample_Subset_Reproject_Bioph_i3.xml -t ‘C:/Users/Ut1/Prova_SNAP_Graph_Builder/LAI_Cab_GeoTiff/provaXML/LAI_Agabiti.tif’ ‘C:/Users/Ut1/Recent images/S2A_MSIL2A_20190213T101131_N0211_R022_T32TQN_20190213T162253.SAFE/MTD_MSIL2A.xml’
Resample_Subset_Reproject_Bioph_i3.xml (3.1 KB)

1 Like