NDVI Batch Processing

Hi, I am trying to compute the NDVI for ~70 Sentinel-2 tiles I downloaded from the USGS website. I created a graph using the band math operator, since the NDVI operator is not available in the graph builder, and loaded the MTD_TL.xml files for each of the tiles in the batch processor. I have tried to run it several times, but it only processes the first couple of files and then says the processing is complete. Let me know if there is anything I might be doing wrong!

I don’t know why the Batch Processing is not correctly working. But I invited someone to this discussion who can probably tell more.

In the mean time I would suggest to do the processing on the command line.
The is a guide in the wiki how to do it.
Bulk Processing with GPT - SNAP Wiki
In the graph XML file you can specify the NDVI operator. It is just the GUI which is not compatible with the Graph Builder.

Hi Jules,

In my experience, Batch Processing is not the best tool for NDVI for the following reasons:

  • NDVI processor is not available in the GUI (I think it’s listed as a bug). It may be possible to use NDI45 instead and select B8 where it asks for B5.
  • It’s hard to apply masking. You can use the land-sea option but it’s a workaround and I also had problems with it.
  • Batch Processing does not change the output filenames!. This means that each time the NDI45 (with B8 instead of B5) processor processes a new file, it overwrites the previous!

As far as I can tell, these are mostly GUI issues. Batch Processing is also available via command line tools.

I wrote a program in Python which does this very simple task. You put all of your Sentinel-2 .zip products in a directory together with a GeoJSON mask file that outlines your study site. The program takes the first zip product, extracts B4 and B8, creates a new NDVI raster and subsets it according to the mask, then moves on with the next product until all products have been processed.

I found this to be the most efficient solution.

A post was split to a new topic: S2 NDVI batch processing with Python