diff --git a/Code/IO/otbImageFileReader.txx b/Code/IO/otbImageFileReader.txx index 3974bdc9a22987de917943188bbbd07b2706e491..4d9c376029efc08ed247d6efe3b642306b312801 100644 --- a/Code/IO/otbImageFileReader.txx +++ b/Code/IO/otbImageFileReader.txx @@ -365,9 +365,10 @@ ImageFileReader<TOutputImage> } // Free memory delete handler; - + std::cout<<geom_kwl<<std::endl; if (!hasMetaData) { + std::cout<<"TU PASSES ICI?????????????????????????"<<std::endl; // Add the plugins factory ossimProjectionFactoryRegistry::instance()->registerFactory(ossimplugins::ossimPluginProjectionFactory::instance()); ossimProjection * projection = ossimProjectionFactoryRegistry::instance() diff --git a/Testing/Code/IO/otbImageKeywordlist.cxx b/Testing/Code/IO/otbImageKeywordlist.cxx index f9f13ced3125a41849ff0d855d12ee7765a7e9d4..01ab65cd6de6ad802589882545d8f0077b6e2ad9 100644 --- a/Testing/Code/IO/otbImageKeywordlist.cxx +++ b/Testing/Code/IO/otbImageKeywordlist.cxx @@ -69,8 +69,9 @@ int otbImageKeywordlist( int argc, char* argv[] ) otb_kwl.SetKeywordlist( geom_kwl ); otb_kwl.convertToOSSIMKeywordlist( geom_kwl2 ); - + //projection->print(std::cout); hasMetaData = projection->loadState(geom_kwl2); + //projection->print(std::cout); hasMetaData = projection->saveState(geom_kwl3); otb::ImageKeywordlist otb_kwl2; otb_kwl2.SetKeywordlist( geom_kwl3 ); diff --git a/Testing/Code/Projections/otbSensorModel.cxx b/Testing/Code/Projections/otbSensorModel.cxx index 91526c615d8eaa9ddd3d20da2eff39e220238e46..651bd43cf1b252c94a815afa192a50573a0061db 100644 --- a/Testing/Code/Projections/otbSensorModel.cxx +++ b/Testing/Code/Projections/otbSensorModel.cxx @@ -64,8 +64,8 @@ int otbSensorModel( int argc, char* argv[] ) itk::Point<double,2> imagePoint; imagePoint[0]=10; imagePoint[1]=10; -// imagePoint[0]=3069; -// imagePoint[1]=1218; + //imagePoint[0]=16271; + // imagePoint[1]=15647; itk::Point<double,2> geoPoint; geoPoint = forwardSensorModel->TransformPoint(imagePoint); diff --git a/Utilities/otbossim/src/ossim/projection/ossimSensorModel.cpp b/Utilities/otbossim/src/ossim/projection/ossimSensorModel.cpp index 3dcf0316926370ed771bece89ca34a5807a149d8..1d92992b7e2c2abdaa8ef67753b407b5919ee2fe 100644 --- a/Utilities/otbossim/src/ossim/projection/ossimSensorModel.cpp +++ b/Utilities/otbossim/src/ossim/projection/ossimSensorModel.cpp @@ -430,6 +430,7 @@ void ossimSensorModel::worldToLineSample(const ossimGpt& worldPoint, //***************************************************************************** std::ostream& ossimSensorModel::print(std::ostream& out) const { + std::cout<<"..............................................................................."<<std::endl; out << setprecision(15) << setiosflags(ios::fixed) << "\n ossimSensorModel base-class data members:\n" << "\n theImageID: " << theImageID @@ -489,9 +490,12 @@ void ossimSensorModel::setGroundRect(const ossimGpt& ul, bool ossimSensorModel::saveState(ossimKeywordlist& kwl, const char* prefix) const { + print(std::cout); if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::saveState: entering..." << std::endl; kwl.add(prefix, IMAGE_ID_KW, theImageID.chars()); + //std::cout<<"====================saveStatee::theImageID : "<<theImageID<<std::endl; + //std::cout<<"====================saveState::theImageID : "<<kwl.find(prefix, IMAGE_ID_KW)<<std::endl; kwl.add(prefix, SENSOR_ID_KW, theSensorID.chars()); kwl.add(prefix, @@ -549,6 +553,9 @@ bool ossimSensorModel::saveState(ossimKeywordlist& kwl, corner.lat, true); + std::cout<<"====================saveStatee::UL_LAT_KW : "<< corner.lat<<std::endl; + std::cout<<"====================saveState::UL_LAT_KW : "<<kwl.find(prefix, ossimKeywordNames::UL_LAT_KW)<<std::endl; + kwl.add(prefix, ossimKeywordNames::UL_LON_KW, corner.lon, @@ -648,6 +655,8 @@ bool ossimSensorModel::loadState(const ossimKeywordlist& kwl, else theImageID = NULL_STRING; + //std::cout<<"****************loadState::theImageID : "<<theImageID<<" "<<value<<std::endl; + keyword = SENSOR_ID_KW; value = kwl.find(prefix, keyword); if (value) @@ -743,6 +752,7 @@ bool ossimSensorModel::loadState(const ossimKeywordlist& kwl, { v[1].lat = ossimString(value).toDouble(); } + std::cout<<"****************loadState::v[1].lat : "<<value<<" , "<<v[1].lat<<" "<<value<<std::endl; keyword = ossimKeywordNames::UR_LON_KW; value = kwl.find(prefix, keyword); @@ -816,10 +826,18 @@ bool ossimSensorModel::loadState(const ossimKeywordlist& kwl, { tmpStr = prefix; } +std::cout<<"++++++++++++++++--++++++++++++ : "<<kwl.find(prefix, IMAGE_ID_KW)<<std::endl; loadAdjustments(kwl, tmpStr); +std::cout<<"++++++++++++++++--++++++++++++ : "<<kwl.find(prefix, IMAGE_ID_KW)<<std::endl; if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::loadState: returning..." << std::endl; - return ossimProjection::loadState(kwl, prefix);; + + bool res = ossimProjection::loadState(kwl, prefix); + //std::cout<<"++++++++++++++++--++++++++++++ : "<<kwl.find(prefix, IMAGE_ID_KW)<<std::endl; + + print(std::cout); + + return res;//ossimProjection::loadState(kwl, prefix); } //***************************************************************************** diff --git a/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp b/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp index bc0b6b6b781e93b81be15fdeacb0c23f30b04cfa..526a247e5e3ecca69f44364eb21e3ffdfc9eef3e 100644 --- a/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp +++ b/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp @@ -1257,6 +1257,11 @@ bool ossimSpotDimapSupportData::saveState(ossimKeywordlist& kwl, theNumBands, true); + kwl.add(prefix, + "image_id", + theImageID, + true); + kwl.add(prefix, "instrument", theInstrument, @@ -1514,6 +1519,7 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl, theNumBands = ossimString(kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW)).toUInt32(); theAcquisitionDate = kwl.find(prefix, ossimKeywordNames::IMAGE_DATE_KW); theProductionDate = kwl.find(prefix, "production_date"); + theImageID = kwl.find(prefix, "image_id"); theInstrument = kwl.find(prefix, "instrument"); theInstrumentIndex = ossimString(kwl.find(prefix, "instrument_index")).toUInt32(); theStepCount = ossimString(kwl.find(prefix, "step_count")).toInt32();