I am trying to make a batch model to convert band 2 and band 1 MODIS 8 day composites into NDVI. The input files are in tif format, but I want the output to be saved in Idrisi .rst format.

I am using QGIS 2.2 64 bit on a Windows 8.1 machine. I installed via the OSgeo4W, and installed everything, so I am using the Orfeo-toolbox for the raster calculator. I am new to QGIS and not very experienced in python either.

The simple model is presented below. Ultimately, I want to batch this, but for the time being I’m just testing to see if I can get a simple model to work. I have tested the data, using the raster calculator directly in QGIS to make an NDVI and this worked without any problems. I just have a lot of images I need do this for....

![screen capture of mode in QGIS][1]

Below I have copied the OTB execution command and the execution console output from QGIS.

My questions are:

What does it mean that I am missing mandatory parameter “il 0”?

Is there a better way to make NDVI images than using the model I have made?

Any help or advice on this matter is greatly appreciated!

OTB execution command

C:/OSGEO4~1\bin\otbcli_BandMath -ram 128 -exp (NIR - RED) / (NIR + RED) -out "C:/8day_NDVI/NDVI_1.rst"

OTB execution console output

ERROR: Missing mandatory parameter: il 0

ERROR: Troubles loading parameter, please check your line argument...

This is the BandMath application, version 4.0.0

Perform a mathematical operation on monoband images

Complete documentation: http://www.orfeo-toolbox.org/Applications/BandMath.html


-progress Report progress

MISSING -il Input image list (mandatory)

-out [pixel] Output Image [pixel=uint8/uint16/int16/uint32/int32/float/double](default value is float) (mandatory)

-ram Available RAM (Mb) (optional, off by default, default value is 128)

-exp Expression (mandatory)

-inxml Load otb application from xml file (optional, off by default)


I think I can answer my own question.

It might be a bug. In searching on the internet, I found this link:


where someone is having a similar issue using OTB band math in QGIS version 2 via sextante. It says in the link that this is apparently only a problem for 64 bit versions. I had version 2.2 which does not have sextante, but I did uninstall the 64 bit version and installed the 32 bit version (via OSgeo4W), and it still didn't work.

Then looking through the GRASS tools I found "r.mapcalculator" and there everything worked great and easy, including batch processing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.