Skip to content
Snippets Groups Projects
Commit 83f69c32 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH : add test for TSARX image metadata

parent 76986c48
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,8 @@ TerraSarImageMetadataInterface::GetSensorID( const MetaDataDictionaryType & dict
ossimKeywordlist kwl;
ImageKeywordlist.convertToOSSIMKeywordlist(kwl);
std::cout<<kwl<<std::endl;
std::cout<<"##########################################################"<<std::endl;
std::string key= "sensor";
ossimString keywordString = kwl.find(key.c_str());
std::string output(keywordString.chars());
......
......@@ -63,6 +63,27 @@ public:
/** Set the image used to get the metadata */
itkSetObjectMacro(Image,ImageType);
/** Get the radiometric bias from the ossim metadata */
VariableLengthVectorType GetPhysicalBias( const MetaDataDictionaryType & ) const
{
VariableLengthVectorType toto;
return toto;
};
/** Get the radiometric gain from the ossim metadata */
VariableLengthVectorType GetPhysicalGain( const MetaDataDictionaryType & ) const
{
VariableLengthVectorType toto;
return toto;
};
/** Get the solar irradiance from the ossim metadata */
VariableLengthVectorType GetSolarIrradiance( const MetaDataDictionaryType & ) const
{
VariableLengthVectorType toto;
return toto;
};
/** Get the sensor ID from the ossim metadata */
std::string GetSensorID(const MetaDataDictionaryType & dict ) const;
......
......@@ -1952,6 +1952,10 @@ ADD_TEST(ioTuQuickBirdImageMetadataInterfaceNew ${IO_TESTS17}
otbQuickBirdImageMetadataInterfaceNew
)
ADD_TEST(ioTuTerraSarImageMetadataInterfaceNew ${IO_TESTS17}
otbTerraSarImageMetadataInterfaceNew
)
IF(OTB_DATA_USE_LARGEINPUT)
ADD_TEST(ioTvImageMetadataInterfaceQBTest ${IO_TESTS17}
--compare-ascii ${NOTOL} ${BASELINE_FILES}/ioTvImageMetadataInterfaceQB.txt
......@@ -1988,6 +1992,14 @@ ADD_TEST(ioTvImageMetadataInterfaceSPOTTest ${IO_TESTS17}
${LARGEDATA}/SPOT5/TEHERAN/IMAGERY.TIF
${TEMP}/ioTvImageMetadataInterfaceSPOT.txt
)
ADD_TEST(ioTvImageMetadataInterfaceTerraSarTest ${IO_TESTS17}
--compare-ascii ${NOTOL} ${BASELINE_FILES}/ioTvImageMetadataInterfaceTerraSarTest.txt
${TEMP}/ioTvImageMetadataInterfaceTerraSarTest.txt
otbImageMetadataInterfaceTest
${LARGEDATA}/TERRASARX/2007-12-15_Toronto_SSC/TSX1_SAR__SSC______SL_S_SRA_20071215T112105_20071215T112107/IMAGEDATA/IMAGE_HH_SRA_spot_074.cos
${TEMP}/ioTvImageMetadataInterfaceTerraSarTest.txt
)
ENDIF(OTB_DATA_USE_LARGEINPUT)
ADD_TEST(ioTvImageMetadataInterfaceTest ${IO_TESTS17}
......@@ -2318,6 +2330,7 @@ otbPointSetFileReader2.cxx
otbSpotImageMetadataInterfaceNew.cxx
otbQuickBirdImageMetadataInterfaceNew.cxx
otbIkonosImageMetadataInterfaceNew.cxx
otbTerraSarImageMetadataInterfaceNew.cxx
otbImageMetadataInterfaceTest.cxx
otbImageMetadataInterfaceTest2.cxx
)
......
......@@ -34,6 +34,7 @@ REGISTER_TEST(otbPointSetFileReader2);
REGISTER_TEST(otbSpotImageMetadataInterfaceNew);
REGISTER_TEST(otbIkonosImageMetadataInterfaceNew);
REGISTER_TEST(otbQuickBirdImageMetadataInterfaceNew);
REGISTER_TEST(otbTerraSarImageMetadataInterfaceNew);
REGISTER_TEST(otbImageMetadataInterfaceTest);
REGISTER_TEST(otbImageMetadataInterfaceTest2);
}
......@@ -43,6 +43,8 @@ int otbTerraSarImageMetadataInterface (int argc, char* argv[])
otb::TerraSarImageMetadataInterface::Pointer lImageMetadata = otb::TerraSarImageMetadataInterface::New();
reader->GetOutput()->GetMetaDataDictionary().Print(std::cout);
std::ofstream file;
file.open(outputFilename);
file<<"GetSensorID: "<<lImageMetadata->GetSensorID(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "itkExceptionObject.h"
#include <fstream>
#include <iostream>
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
#include "otbTerraSarImageMetadataInterface.h"
int otbTerraSarImageMetadataInterfaceNew (int argc, char* argv[])
{
otb::TerraSarImageMetadataInterface::Pointer lImageMetadata = otb::TerraSarImageMetadataInterface::New();
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment