Commit 025e59c3 authored by Manuel Grizonnet's avatar Manuel Grizonnet

ENH: check output filename extension before polygon analysis to avoid useless computation

parent c961654c
......@@ -155,6 +155,22 @@ private:
}
}
}
// Check that the extension of the output parameter is XML (mandatory for
// StatisticsXMLFileWriter)
// Check it here to trigger the error before polygons analysis
if ( HasValue("out") )
{
// Store filename extension
// Check that the right extension is given : expected .xml
const std::string extension = itksys::SystemTools::GetFilenameLastExtension(this->GetParameterString("out"));
if (itksys::SystemTools::LowerCase(extension) != ".xml")
{
otbAppLogFATAL( << extension << " is a wrong extension for parameter \"out\": Expected .xml" );
}
}
}
void DoExecute() ITK_OVERRIDE
......
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