From 18306535b23919a6099cb3911e4cfd2d25c7f35d Mon Sep 17 00:00:00 2001 From: ctraizet <cedric.traizet@c-s.fr> Date: Mon, 25 Mar 2019 15:31:55 +0100 Subject: [PATCH] ENH: added a warning if there is a no data value --- .../AppSegmentation/app/otbSegmentation.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx index 151aac53d8..777325177d 100644 --- a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx @@ -43,6 +43,7 @@ //Utils #include "itksys/SystemTools.hxx" +#include "otbNoDataHelper.h" namespace otb { @@ -467,6 +468,17 @@ private: std::string projRef = GetParameterFloatVectorImage("in")->GetProjectionRef(); + std::vector<bool> noDataFlags; + std::vector<double> noDataValues; + itk::MetaDataDictionary &dict = GetParameterFloatVectorImage("in")->GetMetaDataDictionary(); + bool ret = otb::ReadNoDataFlags(dict,noDataFlags,noDataValues); + + if (ret) + { + otbAppLogWARNING("The input image has no data values but this application does not handle no-data. No-data pixels" + " will be treated as regular pixels."); + } + OGRSpatialReference oSRS(projRef.c_str()); if (segModeType == "vector") -- GitLab