Commit f9cccd08 authored by Julie Brossard's avatar Julie Brossard Committed by Cédric Traizet
Browse files

[TEST] Update test

parent f40a010e
......@@ -1910,7 +1910,6 @@ void GDALImageIO::ExportMetadata()
KeywordlistToMetadata(kwl, bIdx);
++bIdx;
}
}
void GDALImageIO::ImportMetadata()
......@@ -1928,7 +1927,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)
{
......@@ -2016,7 +2014,6 @@ void GDALImageIO::GDALMetadataToKeywordlist(const char* const* metadataList, Ima
m_Imd.Add(MDGeom::RPC, rpcStruct);
}
else{
std::cout << fieldName << ":: " << fieldValue << std::endl ;
kwl.emplace(fieldName, fieldValue);
}
}
......
......@@ -134,12 +134,12 @@ 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
# --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
${INPUTDATA}/metadataIOexample.tif
${TEMP}/ioTvGDALImageIOImportExportMetadata.tif
${TEMP}/ioTvGDALImageIOImportMetadata.txt
)
otb_add_test(NAME ioTvGDALOverviewsBuilder_TIFF COMMAND otbIOGDALTestDriver
......
......@@ -34,33 +34,34 @@ int otbGDALImageIOImportExportMetadata(int itkNotUsed(argc), char* argv[])
// Verify the number of parameters in the command line
const char* inputFilename = argv[1];
const char* outputFilename = argv[2];
const char* outputTextFilename = argv[3];
const char* outputReaderFilename = argv[3];
std::ofstream outfile(outputTextFilename);
std::ofstream outfileR(outputReaderFilename);
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();
}
outfileR << readerGDAL->GetImageMetadata();
}
else
{
{
std::cout << "Read file K0" << std::endl;
return EXIT_FAILURE;
}
}
otb::GDALImageIO::Pointer writerGDAL = otb::GDALImageIO::New();
if(writerGDAL->CanWriteFile(outputFilename))
{
writerGDAL->WriteImageInformation();
}
else
{
return EXIT_FAILURE ;
}
// otb::sGDALImageIO::Pointer io = otb::sGDALImageIO::New();
// io->CanReadFile(inputFilename);
// io->ImportMetadata();
// outfile << io->m_Imd;
//
// otb::sGDALImageIO::Pointer io2 = otb::sGDALImageIO::New();
// io2.CarWriteFile(outputFilename);
// io2->m_Imd = io->m_Imd;
// io2.ExportMetadata();
return EXIT_SUCCESS;
}
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