Commit 3c17874a authored by Julien Osman's avatar Julien Osman
Browse files

FIX: Trim the result of GetMetadataValue so it can be casted

parent b4a4609f
......@@ -63,7 +63,7 @@ public:
int GetNbBands() const override;
/**
* @brief Fill the ImageMetadata with the data from the geom file
* @brief Fill the ImageMetadata with the RPC model from the geom file
*
* @param imd The ImageMetadata to fill
*/
......
......@@ -27,6 +27,7 @@
#include "otbMacro.h"
#include "otbStringUtils.h"
#include "otbStringUtilities.h"
#include <boost/algorithm/string.hpp>
namespace otb
{
......@@ -73,6 +74,7 @@ public:
{
otbGenericExceptionMacro(MissingMetadataException,<<"Missing metadata '"<<path<<"'")
}
boost::trim(ret);
try
{
return boost::lexical_cast<T>(ret);
......@@ -91,6 +93,7 @@ public:
{
return defaultValue;
}
boost::trim(ret);
try
{
return boost::lexical_cast<T>(ret);
......
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