Commit 43bd5e16 authored by Julie Brossard's avatar Julie Brossard

Revert "[WIP] Import metadata in FileReader"

This reverts commit 658c6e7b.
parent ef6b2a5d
......@@ -922,10 +922,6 @@ void GDALImageIO::InternalReadImageInformation()
/* Report metadata. */
/* -------------------------------------------------------------------- */
ImportMetadata() ;
papszMetadata = dataset->GetMetadata(nullptr);
if (CSLCount(papszMetadata) > 0)
{
......@@ -1926,7 +1922,6 @@ void GDALImageIO::ImportMetadata()
m_Imd.FromKeywordlist(kwl);
// GCPs are imported directly in the ImageMetadata.
m_Imd.Add(MDGeom::GCP, m_Dataset->GetGCPParam());
// Parsing the bands
for (int band = 0 ; band < m_NbBands ; ++band)
{
......@@ -1942,7 +1937,7 @@ void GDALImageIO::KeywordlistToMetadata(ImageMetadataBase::Keywordlist kwl, int
{
if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::SensorGeometry))
{
SetMetadataValue("MDGeomNames[MDGeom::SensorGeometry].", kv.second.c_str(), band);
SetMetadataValue("OTB/MDGeomNames[MDGeom::SensorGeometry].", kv.second.c_str(), band);
}
else if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::RPC))
{
......@@ -1957,9 +1952,9 @@ void GDALImageIO::KeywordlistToMetadata(ImageMetadataBase::Keywordlist kwl, int
// WKT projection have already been exported (see InternalWriteImageInformation)
}
else{
// std::string domain = "OTB";
// std::string path = domain + "/" + kv.first ;
SetMetadataValue(kv.first.c_str(), kv.second.c_str(), band);
std::string domain = "OTB";
std::string path = domain + "/" + kv.first ;
SetMetadataValue(path.c_str(), kv.second.c_str(), band);
}
}
}
......@@ -2013,10 +2008,8 @@ void GDALImageIO::GDALMetadataToKeywordlist(const char* const* metadataList, Ima
m_Imd.Add(MDGeom::RPC, rpcStruct);
}
else{
std::cout << fieldName << ":: " << fieldValue << std::endl ;
else
kwl.emplace(fieldName, fieldValue);
}
}
}
......
......@@ -131,14 +131,14 @@ otb_add_test(NAME ioTvGDALImageIOWriteMetadata COMMAND otbIOGDALTestDriver
)
# TODO implement this test
otb_add_test(NAME ioTvGDALImageIOImportExportMetadata_JPEG_99 COMMAND otbIOGDALTestDriver
--compare-ascii ${NOTOL} ${BASELINE_FILES}/ioTvGDALImageIOImportExportMetadata_JPEG_99.txt
${TEMP}/ioTvGDALImageIOImportExportMetadata_JPEG_99.txt
otbGDALImageIOImportExportMetadata
/datas/Documents_Julie/Logiciels/OTB/bin/build/OTB/build/roi.tif
${TEMP}/ioTvGDALImageIOImportExportMetadata_JPEG_99.tif
${TEMP}/ioTvGDALImageIOImportExportMetadata_JPEG_99.txt
)
# otb_add_test(NAME ioTvGDALImageIOImportExportMetadata_JPEG_99 COMMAND otbIOGDALTestDriver
# --compare-ascii ${NOTOL} ${BASELINE_FILES}/ioTvGDALImageIOImportExportMetadata_JPEG_99.txt
# ${TEMP}/ioTvGDALImageIOImportExportMetadata_JPEG_99.txt
# otbGDALImageIOImportExportMetadata
# ${INPUTDATA}/maur_rgb_24bpp.tif
# ${TEMP}/ioTvGDALImageIOImportExportMetadata_JPEG_99.tif
# ${TEMP}/ioTvGDALImageIOImportExportMetadata_JPEG_99.txt
# )
otb_add_test(NAME ioTvGDALOverviewsBuilder_TIFF COMMAND otbIOGDALTestDriver
otbGDALOverviewsBuilder
......
......@@ -37,20 +37,6 @@ int otbGDALImageIOImportExportMetadata(int itkNotUsed(argc), char* argv[])
const char* outputTextFilename = argv[3];
std::ofstream outfile(outputTextFilename);
otb::GDALImageIO::Pointer readerGDAL = otb::GDALImageIO::New();
readerGDAL->SetFileName(inputFilename);
if (readerGDAL->CanReadFile(inputFilename))
{
std::cout << "Read file OK" << std::endl;
readerGDAL->ReadImageInformation();
outfile << readerGDAL->GetImageMetadata();
}
else
{
std::cout << "Read file K0" << std::endl;
return EXIT_FAILURE;
}
// otb::sGDALImageIO::Pointer io = otb::sGDALImageIO::New();
// io->CanReadFile(inputFilename);
......
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