From d6ff4c0fa5ca179e8336e2fa7e898c7869e6eef7 Mon Sep 17 00:00:00 2001 From: Commandre Benjamin <benjamin.commandre@irstea.fr> Date: Thu, 23 May 2019 14:20:04 +0200 Subject: [PATCH] Calling up histogram writing methods --- .../AppClassification/app/otbZonalStatistics.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx b/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx index d7e614b3f0..46f28803ef 100644 --- a/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx @@ -742,12 +742,18 @@ public: // Remove the no-data entry RemoveNoDataEntry(); // Generate output - if (GetParameterAsString("out") == "xml") WriteXMLStatsFile(); + if (GetParameterAsString("out") == "xml") + { + if(GetParameterInt("histogram") == 0) WriteXMLStatsFile(); + else WriteXMLHistogramFile(); + } else // vector or raster { if (m_FromLabelImage) GenerateVectorDataFromLabelImage(); - if (GetParameterAsString("out") == "vector") WriteVectorData(); - else if (GetParameterAsString("out") == "raster") WriteRasterData(); + if (GetParameterAsString("out") == "vector" && GetParameterInt("histogram") == 0 ) WriteVectorData(); + else if (GetParameterAsString("out") == "vector" && GetParameterInt("histogram") != 0 ) WriteVectorHistogramData(); + else if (GetParameterAsString("out") == "raster" && GetParameterInt("histogram") == 0) WriteRasterData(); + else if (GetParameterAsString("out") == "raster" && GetParameterInt("histogram") != 0) WriteRasterHistogramData(); else otbAppLogFATAL("Unknown output mode"); } } -- GitLab