Commit aaa99945 authored by Antoine Regimbeau's avatar Antoine Regimbeau

REFAC: change name and type of metadata key OriginalPixelType to DataType

parent e793d2e6
......@@ -74,7 +74,7 @@ namespace MetaDataKey
extern OTBOSSIMAdapters_EXPORT char const * NoDataValueAvailable;
extern OTBOSSIMAdapters_EXPORT char const * NoDataValue;
extern OTBOSSIMAdapters_EXPORT char const * OriginalPixelType;
extern OTBOSSIMAdapters_EXPORT char const * DataType;
enum KeyType
......
......@@ -21,8 +21,6 @@
#include "otbMetaDataKey.h"
#define NBKEYS 24
namespace otb
{
namespace MetaDataKey
......@@ -66,7 +64,7 @@ char const* TileHintY = "TileHintY";
char const * NoDataValueAvailable = "NoDataValueAvailable";
char const * NoDataValue = "NoDataValue";
char const * OriginalPixelType = "OriginalPixelType";
char const * DataType = "DataType";
}
const MetaDataKey::KeyTypeDef Types[] =
......@@ -96,22 +94,24 @@ const MetaDataKey::KeyTypeDef Types[] =
MetaDataKey::KeyTypeDef(MetaDataKey::TileHintX, MetaDataKey::TENTIER),
MetaDataKey::KeyTypeDef(MetaDataKey::TileHintY, MetaDataKey::TENTIER),
MetaDataKey::KeyTypeDef(MetaDataKey::NoDataValueAvailable, MetaDataKey::TVECTOR),
MetaDataKey::KeyTypeDef(MetaDataKey::NoDataValue, MetaDataKey::TVECTOR)
MetaDataKey::KeyTypeDef(MetaDataKey::NoDataValue, MetaDataKey::TVECTOR),
MetaDataKey::KeyTypeDef(MetaDataKey::DataType, MetaDataKey::TENTIER),
};
MetaDataKey::KeyType MetaDataKey::GetKeyType(const std::string& name)
{
MetaDataKey::KeyType ktype(MetaDataKey::TSTRING);
// MetaDataKey::KeyType ktype(MetaDataKey::TSTRING);
for (unsigned int i = 0; i < NBKEYS; ++i)
for ( const auto & key : Types )
{
if ( name.find(Types[i].keyname) != std::string::npos )
if ( name.find(key.keyname) != std::string::npos )
{
ktype = Types[i].type;
break;
return MetaDataKey::KeyType(key.type);
// ktype = key.type;
// return ktype;
}
}
return (ktype);
return MetaDataKey::KeyType(MetaDataKey::TSTRING);
}
OTB_GCP::OTB_GCP()
......
......@@ -697,9 +697,9 @@ void GDALImageIO::InternalReadImageInformation()
/* Get Pixel type */
/* -------------------------------------------------------------------- */
itk::EncapsulateMetaData< std::string >( dict,
MetaDataKey::OriginalPixelType ,
this->GetComponentTypeAsString( this->GetComponentType() ) );
itk::EncapsulateMetaData< IOComponentType >( dict,
MetaDataKey::DataType ,
this->GetComponentType() );
/* -------------------------------------------------------------------- */
/* Get Spacing */
......
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