GraphBuilder overwriting output file

I created a graph to sequencially read, reproject and write around 20 S3A LST products. The Graph runs properly but each ouput file overwrites the previous since the output root filename is “xfdumanifest” while I see something more like “S3A_SL_2_LST____20171031T022352_20171031T022652_20171031T041751_0179_024_046_2520_SVL_O_NR_002.SEN3” in the GraphBuilder filename field. The “Keep source filename” option is checked.

How do I get GraphBuilder to actually take the name of the product as a basis for output file name ?

Hi, I think you mean batch processing and not the graph builder.

To not overwrite your products, open batch processing, unselect the option ‘Keep source filename’ and load your graph. You will see now that the write tab of your graph appears.

If you run the process now, each input will create an output using the filename as reference and not overwrite the resutls.

Hope it helps,

I know that this is an old thread, but I am having a similar issue of batch processing overwriting output files. I tried all solutions I could find on this forum but so far none of them worked. I have attached the xml file of the graph used with the batch. Any suggestions here?


inversion_LAI.xml (3.4 KB)

What happens when you remove the line for the target product and set the ‘keep product name’ option?

Do you mean removing the “D:\W\LAI\BiophysicalOp.tif” line in the xml file? I did so but it did not change anything when applying the batch.

how about replacing it by


inversion_LAI_ab.xml (3.4 KB)

I get an output file named “{targetFile}.tif”

strange, but you did select this option? grafik

What worked for me:

  1. Open the first product you want to process in SNAP
  2. Open the Graph Builder and select your XML
  3. The product will automatically be taken as Input product and you can define a target name:
    Select the input name + _LAI.dim
  4. Save the graph XML
  5. Open all products you want to process in SNAP
  6. Open the Batch Processing and load all products into the list (make sure the first is the one from the XML)
  7. Load the XML
  8. Make sure that this option is selected grafik
  9. Run the Batch Processing. The first output will have the name as you have defined it statically in the XML. All further products will be adjusted accordingly, at least in my case.

Still not working. I have tried with a simpler graph (subset + resample only) and then the output name is correctly defined. So it seems that the “BiophysicalOp” node causes the issue with the naming.

I am struggling with the same issue that you brought up regarding overwriting output file.

I was just wondering whether you were able to find a solution for overwriting the output file while batch processing a time series data.

Unfortunately not, but I did not spend as much time as I’d wish on this matter… I’ll update the post if I find a solution.

I’ve been running into the same problem, but my batch processing box (SNAP 8) does not have the ‘keep source product name’ box.

Screen Shot 2020-12-08 at 2.02.33 AM (2)

Hi, I think you need to load your graph first.

No - I’m afraid it doesn’t make a difference if the graph is loaded (or if the files are added).

(Edit: In SNAP6 this isn’t an issue. Would be a shame if SNAP8 doesn’t allow this though.)

I am having the same problem (using Snap 8.0). There is no option to select “Keep source product name”. As I have seen on other posts on the forum, they were using old versions of Snap and it had that option… Still don’t know how to save files with different output names.

If you use a different directory to save your processed data, the products saved will keep the original name and add a suffix with the name of the process.

Yes. I am writing the output files to a different drive altogether but it is still overwriting the existing file and not saving the other file separately. Please look at the two screenshots below. My input files are stored at desktop and I am outputting the result to a different drive.
I have S3SLSTR data downloaded for whole 2020, and I want to batch process them to output BT bands in the form of CSV.

@lveci @MartinoF Can you check why writing to different output product is not working anymore?

I’m so sorry… It was not working because my 2nd file did not have the required pixel area which I wanted to extract… The writing feature is working fine I have used it on 30 files at once…

1 Like

I removed the name of the image (i.e. I used ‘[file][/file]’) in the xml file for the read and write operators and the “Batch Processing” seems to work as wished. Something like:

[node id=“Read”]

And then
[node id=“Write”]