Commit c5727cd4 authored by Julien Osman's avatar Julien Osman

BUG: Fix GeomMetadataSupplier::GetNbBands

parent 5a895bdd
Pipeline #5952 failed with stages
in 92 minutes and 24 seconds
......@@ -24,10 +24,9 @@
#include "OTBMetadataExport.h"
#include <vector>
#include <string>
#include "otbStringUtils.h"
#include "otbMacro.h"
#include "otbStringUtilities.h"
#include "otbStringUtils.h"
#include "otbStringUtilities.h"
namespace otb
{
......
......@@ -24,6 +24,7 @@
#include "otbGeomMetadataSupplier.h"
#include "otbMetaDataKey.h"
#include "otbGeometryMetadata.h"
#include "otbStringUtils.h"
namespace otb
{
......@@ -52,7 +53,13 @@ std::string GeomMetadataSupplier::GetResourceFile(std::string) const
int GeomMetadataSupplier::GetNbBands() const
{
return this->GetAsVector<std::string>("support_data.band_name_list").size();
bool hasValue;
std::string ret = this->GetMetadataValue("support_data.band_name_list", hasValue);
if (!hasValue)
otbGenericExceptionMacro(MissingMetadataException,<<"Missing metadata 'support_data.band_name_list'")
std::vector<std::string> ret_vect;
otb::Utils::ConvertStringToVector(ret, ret_vect, "band name");
return ret_vect.size();
}
const boost::any& GeomMetadataSupplier::FetchRPC(ImageMetadata & imd)
......
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