diff --git a/Code/IO/otbTerraSarImageMetadataInterface.cxx b/Code/IO/otbTerraSarImageMetadataInterface.cxx index b5e3f6c88c34af46ba2d033e3a3652dd67e5ec52..995f06ca47f3fef147e33591c29c5c7de77d748b 100644 --- a/Code/IO/otbTerraSarImageMetadataInterface.cxx +++ b/Code/IO/otbTerraSarImageMetadataInterface.cxx @@ -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()); diff --git a/Code/IO/otbTerraSarImageMetadataInterface.h b/Code/IO/otbTerraSarImageMetadataInterface.h index fa521aca79e6410328f7649dbc0eff5e8a198ca6..0ca5ec2ae7c1f8e9a12448ebcde00320cd57bb37 100644 --- a/Code/IO/otbTerraSarImageMetadataInterface.h +++ b/Code/IO/otbTerraSarImageMetadataInterface.h @@ -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; diff --git a/Testing/Code/IO/CMakeLists.txt b/Testing/Code/IO/CMakeLists.txt index 7715ca8d0996b5bee3f9b9d9ac626d07d43f41de..ea165bcb386812262bcefd973275d5c10e47ecd3 100755 --- a/Testing/Code/IO/CMakeLists.txt +++ b/Testing/Code/IO/CMakeLists.txt @@ -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 ) diff --git a/Testing/Code/IO/otbIOTests17.cxx b/Testing/Code/IO/otbIOTests17.cxx index ce4f010b3d5fb7b55a9983a51628d1b3d84fc36a..b9d0f8e03b7fb6622310616554fd3eada8d7d44c 100644 --- a/Testing/Code/IO/otbIOTests17.cxx +++ b/Testing/Code/IO/otbIOTests17.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); } diff --git a/Testing/Code/IO/otbTerraSarImageMetadataInterface.cxx b/Testing/Code/IO/otbTerraSarImageMetadataInterface.cxx index 346af06676d6525417d6b21a0cea5d356ae2cc1d..7fa5790e5e04b42aa1684309fbe81dc6410bacf5 100644 --- a/Testing/Code/IO/otbTerraSarImageMetadataInterface.cxx +++ b/Testing/Code/IO/otbTerraSarImageMetadataInterface.cxx @@ -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; diff --git a/Testing/Code/IO/otbTerraSarImageMetadataInterfaceNew.cxx b/Testing/Code/IO/otbTerraSarImageMetadataInterfaceNew.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b49f7c25cb1044b4e043a5b18df0e9ab9f302330 --- /dev/null +++ b/Testing/Code/IO/otbTerraSarImageMetadataInterfaceNew.cxx @@ -0,0 +1,38 @@ +/*========================================================================= + + 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; + +}