Skip to content
Snippets Groups Projects
Commit adddef63 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

ENH:revert pixel description

parent 3e5d4614
No related branches found
No related tags found
No related merge requests found
......@@ -420,36 +420,6 @@ ImageMetadataInterfaceBase::GetBandName( const MetaDataDictionaryType & dict ) c
return outputValues;
}
double ImageMetadataInterfaceBase::GetXPixelSpacing( const MetaDataDictionaryType & dict ) const
{
ImageKeywordlistType ImageKeywordlist;
if (dict.HasKey(MetaDataKey::OSSIMKeywordlistKey))
{
itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, ImageKeywordlist);
}
ossimKeywordlist kwl;
ImageKeywordlist.convertToOSSIMKeywordlist(kwl);
std::string key= "support_data.x_pixel_spacing";
ossimString keywordString = kwl.find(key.c_str());
return keywordString.toDouble();
}
double ImageMetadataInterfaceBase::GetYPixelSpacing( const MetaDataDictionaryType & dict ) const
{
ImageKeywordlistType ImageKeywordlist;
if (dict.HasKey(MetaDataKey::OSSIMKeywordlistKey))
{
itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, ImageKeywordlist);
}
ossimKeywordlist kwl;
ImageKeywordlist.convertToOSSIMKeywordlist(kwl);
std::string key= "support_data.y_pixel_spacing";
ossimString keywordString = kwl.find(key.c_str());
return keywordString.toDouble();
}
void
ImageMetadataInterfaceBase::PrintSelf(std::ostream& os, itk::Indent indent, const MetaDataDictionaryType & dict) const
{
......
......@@ -201,14 +201,6 @@ public:
/** Get the last wavelength for the spectral band definition */
virtual VariableLengthVectorType GetLastWavelengths( const MetaDataDictionaryType & dict ) const =0;
otbMetadataGetMacro(LastWavelengths, VariableLengthVectorType);
/** Get the x resolution */
double GetXPixelSpacing( const MetaDataDictionaryType & dict ) const;
otbMetadataGetMacro(XPixelSpacing, double);
/** Get the y resolution */
double GetYPixelSpacing( const MetaDataDictionaryType & dict ) const;
otbMetadataGetMacro(YPixelSpacing, double);
virtual bool CanRead( const MetaDataDictionaryType & dict ) const =0;
......
......@@ -301,30 +301,6 @@ ImageLayer<TImage,TOutputImage>
oss << otbGetTextMacro("Location unknown") << std::endl;
}
}
/** Metadatas typedef */
typedef typename ImageMetadataInterfaceBase ImageMetadataInterfaceType;
typedef typename ImageMetadataInterfaceBase::Pointer ImageMetadataInterfacePointerType;
// Build the metadata interface
ImageMetadataInterfacePointerType lImageMetadata = ImageMetadataInterfaceType::New();
// Check availability
bool mdIsAvailable = lImageMetadata->CanRead(m_Image->GetMetaDataDictionary());
if (mdIsAvailable)
{
double x_spacing = lImageMetadata->GetXPixelSpacing(m_Image->GetMetaDataDictionary());
double y_spacing = lImageMetadata->GetYPixelSpacing(m_Image->GetMetaDataDictionary());
oss<< "x res: " << x_spacing << std::endl;
oss<< "y res: " << y_spacing << std::endl;
}
else
{
oss << otbGetTextMacro("Resolution unknown") << std::endl;
}
return oss.str();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment