Naming files with Graph Builder and Batch Processing

I have been trying to use the batch processing tools in Snap, and I cannot seem to get the batch processing tool to rename my files correctly. Below is my input. When selecting a file from the dropdown menu in the graph builder, I appear to get correctly named output files.

However, as a part of saving my model for later usage, you end up saving the name of the file that was originally being used, like so…

I loaded the following files into Snap for batch processing,

When processing the files, I ended up with an entry for every file in the product explorer, but they’re all named the same thing.
Batch_Processing_Product_Explorer

When I looked in the Windows Explorer window, I found that I actually had one file. I’m assuming that each iteration in the batch processor simply overwrote the previous file.

I tried to get the graph builder to rename the output file to match the input file, but the “solution” so far has been to select another file and reselect my initial file.

I also tried saving the output file name to include _NDVI at the end. In this instance, I selected the input file until the input name and the output name matched in the graph builder. I saved the graph with the change to the output, and I ended up with a single file being named with _NDVI, while the rest have _BandMath.

It’s not simply adding _BandMath to the output; otherwise, I would expect to see_NDVI_BandMath for the first file.

Is there a better way to indicate that I just want the output file name to match the input file name in the graph builder, and is there a way to process files using batch mode such that you can control the output name for all files processed, perhaps something like {{input}}_NDVI?

I am using SNAP version 9.0.6.

I think naming issues have been reported before, @diana_harosa could you check whether there are older open tickets about them?

I found this open ticket SNAP-1415. There are also some workarounds available until this issue will be fixed:

  1. Batch Processing - wrong name - #4 by Teracotta
  2. If the first one doesn’t work, you can modify your graph as described here GraphBuilder overwriting output file - #20 by hamego → the output will be created in %USERPROFILE% folder.
1 Like