Skip to content
Snippets Groups Projects
Commit 025e59c3 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

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

parent c961654c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment