NdviOp missing from graph builder

The NdviOp is available in the Thematic Land Processing drop down menu, but it’s not available in the graph builder. Is this a known bug or is it just an issue with my installation?

1 Like

Dear gsk33,

Please be informed that the issue related to NdviOp not available in the Graph Builder is known and it will be fixed in coming module updates.
In order to apply NDVI in the Graph Builder you could use the BandMath module.

Best Regards,


It’s strange that other indices are available but not ndvi

The NDVI Operator was one of the first operators developed. The Graph Builder and the other indices came later. Unfortunately, it is not fully compatible with the Graph Builder. This will be fixed in the future.

It is also simple to implement using band maths in the graph builder and then merging with the other bands.

By ‘merge’ do you mean that the output file will contain bot the LAI and NDVI calculated bands?
I’ve been trying to do this and can’t see how.
Also, is it possible to create a subset, and then do maths on the subset without writing it to file first?

I think the merge option only exists on the gpt (command line mode). But you could “Collocate” the images (Raster/Geometric/Collocation).
Using the graph builder is possible to do something like this:

I tried that and it didn’t work!
This is what i want to do:

It wont calculate the LAI from the NDVI value generated by ‘band maths’ unless i do that in a separate graph (write the resampled product and then run another graph on that)
Also, when i try and do batch processing, I can only load in 12 separate Products, is there a limit on this do you know?

can you please share the XML?

I think so!
landsatresample2.xml (2.3 KB)

this only contains the first two steps:

Sorry, I’m still having difficulty with creating the graphs.
I can get this one to run, but i need the final output to have both the NDVI (generated in band maths) and the LAI (bandmaths2) bands in the output file. (XML file below)

XML: LS8_LAI_NDVI.xml (3.6 KB)

your first approach was almost right - please divide the graph into two band maths after the Resample operator and merge them in the Write operator.


Thanks @ABraun gyt that doesn’t work, as ‘band maths2’ uses the value generated by ‘band mathss’ not a value from the ‘ressampled’ operator. The Graph runs as shown, but only writes the LAI band from ‘band maths2’. Also, once it has run, i get the error shown, and if I try and edit tyhe expression there is no source listed in the editor.
(.XML below)

LS8_LAI_NDVI.xml (3.6 KB)

works for me - could it be that the subset operator produces an empty product because the defined polygon does not intersect the input data? I had to adjust it to my data as a test and the processing finished. You can remove the subset and test if the graph then is correct.

Does it write both LAI and NDVI bands in the output product for you?
Also, if I try and run it using batch processing, i can only add 12 products to the batch processing table, is this normal?

please, one thing after the other. Let’s first get the script to work so that the second Band Math does not produce an error.

My apologies Andreas, I often get too focused on what i want the end product to be!
(BTW the reasin that the batch processor won’t open all the files is that some of them cant be read by SNAP, I dont know why, but thats another issue :slight_smile: )
the script worked, apart from the fact that it didn;t write the NDVI band in the final product. It obviously calculated the NDVI as ity wouldn’t be able to calculate the LAI without it. So logic dictates that the problem is with the write operator?

no worries, we are getting closer. The key is the band merge operator, but I noticed that the order in which the different operators are added is very sensitive and often results in an error.

Please try this one: LS8_LAI_NDVI_v4.xml (3.9 KB)

That’s brilliant, Thanks Andreas :slight_smile:
worked perfectly
I’ll have a closer look at it tomorrow to work out how you did the 'band merge operator

Thanks Again