Commit e7d4d8e0 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

TEST: Adding inxml parameter in Python wrapper via BandMath

parent bb9821ac
......@@ -32,3 +32,12 @@ add_test( NAME pyTvBug440
${TEMP}/pyTvBug440Output.tif
)
add_test( NAME pyTvBandMathInXML
COMMAND ${TEST_DRIVER} Execute
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonOutXMLTest.py
${OTB_DATA_ROOT}/Input/verySmallFSATSW_r.tif
${OTB_DATA_ROOT}/Input/verySmallFSATSW_nir.tif
${OTB_DATA_ROOT}/Input/verySmallFSATSW.tif
${TEMP}/pyTvBandMathInXML.tif
)
# -*- coding: utf-8 -*-
#
# Example on the use of the outxml via BandMath
#
import sys
import otbApplication as otb
filelen = sys.argc-2
imagelist = []
for i in range(1,filelen):
imagelist.append(sys.argv[i])
app = otb.Registry_CreateApplication('BandMath')
app.SetParameterStringList("il", imagelist)
app.SetParameterString("out", sys.argv[filelen + 1])
app.SetParameterString("exp", "cos(im1b1)+im2b1*im3b1-im3b2+ndvi(im3b3, im3b4)")
app.SetParameterString("outxml", sys.argv[filelen + 2])
#app.SetParameterString("inxml", "/home/rashad/python_xmlout.xml")
for paramKey in app.GetParametersKeys():
app.GetParameterValue(paramKey)
#app.ExecuteAndWriteOutput()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment