Commit c5b55399 authored by Stéphane Albert's avatar Stéphane Albert

MRG: Synchronized rfc-24-GDAL_overviews with develop.

parents c02e6bb9 699571de
......@@ -92,18 +92,9 @@ SET(DVIPS_CONVERTER_OPTIONS -D600)
SET(TEX4HT_OPTIONS html,2,sections+)
SET (HTML_OUTPUT "SoftwareGuide-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
#
#copy release_notes from source tree
#
# Copy RELEASE_NOTES.txt from OTB source tree to Software Guide build directory
SET (RELEASE_NOTES_SRC RELEASE_NOTES.txt)
#TODO transform the copy as a custom command
#ADD_CUSTOM_COMMAND(
# PRE_BUILD
# OUTPUT ${SoftwareGuide_SOURCE_DIR}/Latex/${RELEASE_NOTES_SRC}
# COMMAND ${CMAKE_COMMAND} -E copy ${OTB_SOURCE_DIR}/${RELEASE_NOTES_SRC} ${SoftwareGuide_SOURCE_DIR}/Latex/${RELEASE_NOTES_SRC}
# COMMENT "Copying the Release Notes"
#)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy "${OTB_SOURCE_DIR}/${RELEASE_NOTES_SRC}" "${SoftwareGuide_SOURCE_DIR}/Latex/${RELEASE_NOTES_SRC}")
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy "${OTB_SOURCE_DIR}/${RELEASE_NOTES_SRC}" "${SoftwareGuide_BINARY_DIR}/Latex/${RELEASE_NOTES_SRC}")
#
# File that defines the path to .cxx examples in ITK sources
......@@ -167,12 +158,6 @@ FOREACH( exampletexname ${JAVA_EXAMPLES_TEX_FILES})
SET( ITK_EXAMPLES_TEX_SRCS ${ITK_EXAMPLES_TEX_SRCS} ${exampletexname})
ENDFOREACH( exampletexname )
#Generate random contributor list
MESSAGE(STATUS "Generating contributors list")
EXECUTE_PROCESS(COMMAND python generateRandomContributorList.py
WORKING_DIRECTORY ${SoftwareGuide_SOURCE_DIR}/Latex/ )
MESSAGE(STATUS "Generating contributors list done")
IF (NOT UNIX)
SET(ITK_TEXINPUTS ${SoftwareGuide_SOURCE_DIR}/../Latex;${SoftwareGuide_SOURCE_DIR};${SoftwareGuide_SOURCE_DIR}/Latex;${SoftwareGuide_SOURCE_DIR}/Art;${SoftwareGuide_BINARY_DIR};${SoftwareGuide_BINARY_DIR}/Examples;${SoftwareGuide_BINARY_DIR}/Art;${SoftwareGuide_BINARY_DIR}/Latex)
......
Adamo Ferro,
Aik Song Chia (CRISP),
Alexis Huck (Magellium),
Amit Kulkarni,
Angelos Tzotsos,
Antonio Valentino,
Aur\'elien Bricier (CS),
Caroline Ruffel (CS),
Charles Peyrega (CS),
Christophe Lay,
Christophe Palmann (CS),
Conrad Bielski (JRC),
Cyrille Valladeau (CS),
David Dubois,
David Youssefi (CNES Intern, then CS),
Edouard Barthelet (Telecom Bretagne and Thales Communications),
Emmanuel Christophe (CNES, then CRISP, then Google),
Eric Bughin (CMLA),
Etienne Bougoin (CS),
Gr\'egoire Mercier (Telecom Bretagne),
Guillaume Borrut (CS),
Guillaume Pasero (CNES Intern, then CS),
Gwendoline Blanchet (CNES),
Jan Wegner,
Jean-Guilhem Cailton (Ark\'emie),
Jens Ziehn (CNES Intern),
Jonathan Guinet (CS),
Jordi Inglada (CNES),
Julien Malik (CS),
Julien Michel (CS then CNES),
Julien Osman,
Julien Radoux (UCL),
Laurentiu Nicola (CS Romania),
Luc Hermitte (CS),
Manuel Grizonnet (CNES),
Massimo Di Stefano,
Mathieu Deltorre (CS),
Miarintsoa Ramanantsimiavona,
Michael Seymour (EADS),
Mickael Savinaud (CS),
Mohammed Rashad (CNES Intern, then CS),
Otmane Lahlou (CS),
Patrick Imbo (CS),
Remi Cresson (Irstea),
Rik Bellens,
Romain Garrigues (CS),
S\'ebastien Dinot (CS),
S\'ebastien Harasse (CS),
St\'ephane Albert (CS),
Stephane May (CNES),
Thomas Feuvrier (CS),
Tishampati Dhar,
Victor Poughon (CNES),
Vincent Poulain (CNES),
Vincent Schut (Sarvision),
Yannick Reynard
Jordi Inglada (CNES)
Thomas Feuvrier (CS)
Julien Michel (CS then CNES)
Romain Garrigues (CS)
Emmanuel Christophe (CNES, then CRISP, then Google)
Cyrille Valladeau (CS)
Julien Radoux (UCL)
Gr\'egoire Mercier (Telecom Bretagne)
Vincent Poulain (CNES)
Christophe Palmann (CS)
Patrick Imbo (CS)
Caroline Ruffel (CS)
Miarintsoa Ramanantsimiavona
Eric Bughin (CMLA)
Guillaume Borrut (CS)
Mathieu Deltorre (CS)
Vincent Schut (Sarvision)
David Dubois
Jan Wegner
Otmane Lahlou (CS)
Michael Seymour (EADS)
Julien Osman
Christophe Lay
Yannick Reynard
Gwendoline Blanchet (CNES)
Adamo Ferro
Rik Bellens
Jean-Guilhem Cailton (Ark\'emie)
Etienne Bougoin (CS)
Tishampati Dhar
Massimo Di Stefano
Aik Song Chia (CRISP)
Manuel Grizonnet (CNES)
Stephane May (CNES)
Conrad Bielski (JRC)
Antonio Valentino
Aur\'elien Bricier (CS)
S\'ebastien Dinot (CS)
Julien Malik (CS)
Amit Kulkarni
Angelos Tzotsos
Edouard Barthelet (Telecom Bretagne and Thales Communications)
Guillaume Pasero (CNES Intern, then CS)
Jonathan Guinet (CS)
Mickael Savinaud (CS)
Alexis Huck (Magellium)
S\'ebastien Harasse (CS)
Jens Ziehn (CNES Intern)
Luc Hermitte (CS)
Charles Peyrega (CS)
St\'ephane Albert (CS)
David Youssefi (CNES Intern, then CS)
Mohammed Rashad (CNES Intern, then CS)
Remi Cresson (Irstea)
Laurentiu Nicola (CS Romania)
Victor Poughon (CNES)
Romain Garrigues (CS), Manuel Grizonnet (CNES), Guillaume Pasero (CNES Intern, then CS), Julien Michel (CS then CNES), Vincent Schut (Sarvision), S\'ebastien Dinot (CS), Massimo Di Stefano, Christophe Lay, Guillaume Borrut (CS), Christophe Palmann (CS), Conrad Bielski (JRC), Angelos Tzotsos, Thomas Feuvrier (CS), Gwendoline Blanchet (CNES), Rik Bellens, Charles Peyrega (CS), Gr\'egoire Mercier (Telecom Bretagne), Mickael Savinaud (CS), Cyrille Valladeau (CS), Jean-Guilhem Cailton (Ark\'emie), Miarintsoa Ramanantsimiavona, Emmanuel Christophe (CNES, then CRISP, then Google), Mathieu Deltorre (CS), Remi Cresson (Irstea), Antonio Valentino, Eric Bughin (CMLA), David Dubois, Jan Wegner, Stephane May (CNES), Laurentiu Nicola (CS Romania), Jens Ziehn (CNES Intern), Luc Hermitte (CS), Michael Seymour (EADS), Tishampati Dhar, Yannick Reynard, Victor Poughon (CNES), Adamo Ferro, Caroline Ruffel (CS), Julien Osman, Vincent Poulain (CNES), St\'ephane Albert (CS), Amit Kulkarni, Jonathan Guinet (CS), Aur\'elien Bricier (CS), Julien Radoux (UCL), Otmane Lahlou (CS), S\'ebastien Harasse (CS), Patrick Imbo (CS), Etienne Bougoin (CS), Aik Song Chia (CRISP), Alexis Huck (Magellium), David Youssefi (CNES Intern, then CS), Mohammed Rashad (CNES Intern, then CS), Edouard Barthelet (Telecom Bretagne and Thales Communications), Julien Malik (CS)
\ No newline at end of file
......@@ -9,9 +9,12 @@ process for the documentation, many examples and even the \LaTeX~ ~
sources were taken from ITK. We are very grateful to the ITK
developers and contributors and especially to Luis Ib\'a\~nez.\\
The OTB specifics were implemented and documented by the OTB Development Team with some help from several contributors. Without these people\footnote{this list has been generated at random without any hierarchy or amount of contribution consideration}, OTB will not be where it is today:
The OTB specifics were implemented and documented by the OTB Development Team
with some help from several contributors. Without these people OTB will not be
where it is today. This list is presented in alphabetical order and not by
importance of contribution:
\input{ContributorListRandom.tex}
\input{ContributorList.tex}
Contributions from users are expected and encouraged for the coming
versions of the ORFEO ToolBox.
......
\chapter{Reading and Writing Images}
2;rgb:0000/0000/0000\chapter{Reading and Writing Images}
\label{sec:IO}
This chapter describes the toolkit architecture supporting reading and
......@@ -285,6 +285,11 @@ IMPORTANT: Note that you'll probably need to "quote" the filename.
\item To activate writing of external geom file
\item true by default
\end{itemize}
\item \begin{verbatim}&writerpctags=<(bool)true>\end{verbatim}
\begin{itemize}
\item To activate writing of RPC tags in TIFF files
\item false by default
\end{itemize}
\item \begin{verbatim}&gdal:co:<GDALKEY>=<VALUE>\end{verbatim}
\begin{itemize}
\item To specify a gdal creation option
......
#!/usr/bin/python
import random
inputFilename = 'ContributorList.txt'
outputFilename = 'ContributorListRandom.tex'
inputFile=open(inputFilename, 'r')
contributors = inputFile.readlines()
inputFile.close()
#remove empty lines
contributors = filter(lambda x:len(x)>5, contributors)
#remove trailing return
contributors = map(lambda x: x[0:len(x)-1], contributors)
randomIndex = range(len(contributors))
random.shuffle(randomIndex)
outputFile=open(outputFilename, 'w')
for i in range(1,len(contributors)-1):
outputFile.write(contributors[randomIndex[i]])
outputFile.write(', ')
outputFile.write(contributors[randomIndex[len(contributors)-1]])
outputFile.close()
......@@ -84,30 +84,30 @@ otb_add_test(NAME bfTeIndexedToRGBExampleTest COMMAND ${OTB_TEST_DRIVER}
${TEMP}/buildingExtractionRGB.png
${TEMP}/buildingExtractionIndexed_scaled.png
)
if(OTBMathParser_LOADED)
otb_add_test(NAME bfTeMeanShiftSegmentationFilterExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 4
${BASELINE}/MSClusteredOutput.tif
${TEMP}/MSClusteredOutput.tif
${BASELINE}/MSLabeledOutput.tif
${TEMP}/MSLabeledOutput.tif
${BASELINE}/MSLabeledOutput-pretty.png
${TEMP}/MSLabeledOutput-pretty.png
${BASELINE}/MSClusteredOutput-pretty.png
${TEMP}/MSClusteredOutput-pretty.png
Execute $<TARGET_FILE:MeanShiftSegmentationFilterExample>
${INPUTDATA}/ROI_QB_MUL_1.png
${TEMP}/MSLabeledOutput.tif
${TEMP}/MSClusteredOutput.tif
${TEMP}/MSLabeledOutput-pretty.png
${TEMP}/MSClusteredOutput-pretty.png
16
16
100
100
0.1
)
endif()
#if(OTBMathParser_LOADED)
#otb_add_test(NAME bfTeMeanShiftSegmentationFilterExampleTest COMMAND ${OTB_TEST_DRIVER}
#--compare-n-images ${NOTOL} 4
#${BASELINE}/MSClusteredOutput.tif
#${TEMP}/MSClusteredOutput.tif
#${BASELINE}/MSLabeledOutput.tif
#${TEMP}/MSLabeledOutput.tif
#${BASELINE}/MSLabeledOutput-pretty.png
#${TEMP}/MSLabeledOutput-pretty.png
#${BASELINE}/MSClusteredOutput-pretty.png
#${TEMP}/MSClusteredOutput-pretty.png
#Execute $<TARGET_FILE:MeanShiftSegmentationFilterExample>
#${INPUTDATA}/ROI_QB_MUL_1.png
#${TEMP}/MSLabeledOutput.tif
#${TEMP}/MSClusteredOutput.tif
#${TEMP}/MSLabeledOutput-pretty.png
#${TEMP}/MSClusteredOutput-pretty.png
#16
#16
#100
#100
#0.1
#)
#endif()
# ------- HillShadingExampleTest ----------
otb_add_test(NAME bfTeHillShadingExampleTest COMMAND ${OTB_TEST_DRIVER}
......
......@@ -18,15 +18,15 @@ otb_add_test(NAME dmTeSimpleDisparityMapEstimationExampleTest COMMAND ${OTB_TEST
)
if(OTBMathParser_LOADED)
otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${NOTOL}
${BASELINE}/elevationOutput.tif
${TEMP}/elevationOutput.tif
Execute $<TARGET_FILE:StereoReconstructionExample>
${INPUTDATA}/sensor_stereo_left.tif
${INPUTDATA}/sensor_stereo_right.tif
${TEMP}/elevationOutput.tif
${TEMP}/elevationOutputPrintable.png
140
)
endif()
\ No newline at end of file
#otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
#--compare-image ${NOTOL}
#${BASELINE}/elevationOutput.tif
#${TEMP}/elevationOutput.tif
#Execute $<TARGET_FILE:StereoReconstructionExample>
#${INPUTDATA}/sensor_stereo_left.tif
#${INPUTDATA}/sensor_stereo_right.tif
#${TEMP}/elevationOutput.tif
#${TEMP}/elevationOutputPrintable.png
#140
#)
endif()
......@@ -22,24 +22,24 @@ otb_add_test(NAME trTeOBIAShapeAttributeComputationTest COMMAND ${OTB_TEST_DRIVE
${TEMP}/OBIAShapeAttribute.txt
)
if(OTBMathParser_LOADED)
otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${NOTOL}
${BASELINE}/OBIARadiometricAttributes.png
${TEMP}/OBIARadiometricAttributes.png
Execute $<TARGET_FILE:RadiometricAttributesLabelMapFilterExample>
${INPUTDATA}/qb_RoadExtract.tif
${TEMP}/OBIARadiometricAttributes.png
${TEMP}/qb_RoadExtract_Radiometry_pretty.png
STATS::Band1::Mean
0
0.5
16
16
50
1.0
)
endif()
#if(OTBMathParser_LOADED)
#otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_TEST_DRIVER}
#--compare-image ${NOTOL}
#${BASELINE}/OBIARadiometricAttributes.png
#${TEMP}/OBIARadiometricAttributes.png
#Execute $<TARGET_FILE:RadiometricAttributesLabelMapFilterExample>
#${INPUTDATA}/qb_RoadExtract.tif
#${TEMP}/OBIARadiometricAttributes.png
#${TEMP}/qb_RoadExtract_Radiometry_pretty.png
#STATS::Band1::Mean
#0
#0.5
#16
#16
#50
#1.0
#)
#endif()
otb_add_test(NAME trTeLabelMapToVectorData COMMAND ${OTB_TEST_DRIVER}
Execute $<TARGET_FILE:LabelMapToVectorData>
......
......@@ -194,15 +194,15 @@ otb_add_test(NAME seTeNeighborhoodConnectedImageFilterTest3 COMMAND ${OTB_TEST_D
# ------- WatershedSegmentationTest----------
otb_add_test(NAME seTeWatershedSegmentationTest2 COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 1
${BASELINE}/WatershedSegmentation1Output2.png
${TEMP}/WatershedSegmentation1Output2.png
Execute $<TARGET_FILE:WatershedSegmentation>
${INPUTDATA}/ROI_QB_MUL_3.tif
${TEMP}/WatershedSegmentation1Output2.png
2 10 0.001 0.15 0
)
#otb_add_test(NAME seTeWatershedSegmentationTest2 COMMAND ${OTB_TEST_DRIVER}
#--compare-n-images ${NOTOL} 1
#${BASELINE}/WatershedSegmentation1Output2.png
#${TEMP}/WatershedSegmentation1Output2.png
#Execute $<TARGET_FILE:WatershedSegmentation>
#${INPUTDATA}/ROI_QB_MUL_3.tif
#${TEMP}/WatershedSegmentation1Output2.png
#2 10 0.001 0.15 0
#)
# ------- ConnectedThresholdImageFilterTest----------
......@@ -291,4 +291,4 @@ otb_add_test(NAME seTeStreamingMeanShiftSegmentationTest COMMAND ${OTB_TEST_DRIV
1 #Simplify Flag
0.2 #Simplification tolerance
)
endif()
\ No newline at end of file
endif()
/*=========================================================================
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.
=========================================================================*/
#include <iostream>
#include <iomanip>
#include <fstream>
#include "otbMacro.h"
#include "otbImageKeywordlist.h"
#include "ossim/base/ossimKeywordlist.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "ossim/projection/ossimProjection.h"
#include "ossim/projection/ossimProjectionFactoryRegistry.h"
#include "ossim/base/ossimFilename.h"
#pragma GCC diagnostic pop
#else
#include "ossim/projection/ossimProjection.h"
#include "ossim/projection/ossimProjectionFactoryRegistry.h"
#include "ossim/base/ossimFilename.h"
#endif
#include "ossim/ossimPluginProjectionFactory.h"
int otbImageKeywordlist(int argc, char* argv[])
{
if (argc != 4)
{
std::cout << argv[0] << " <input filename> <output filename> <output filename2>" << std::endl;
return EXIT_FAILURE;
}
char * filename = argv[1];
char * outFilename = argv[2];
char * outFilename2 = argv[3];
std::ofstream file;
file.open(outFilename);
file << std::setprecision(15);
std::ofstream file2;
file2.open(outFilename2);
file2 << std::setprecision(15);
bool hasMetaData = false;
ossimKeywordlist geom_kwl, geom_kwl2, geom_kwl3;
/** Don't use FactoryRegistry because of its default factory that can conflict
* with plugins factor (cf. TSX .tif image read as QB)*/
// test ossim plugin factory
ossimProjection * projection = ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(
ossimFilename(filename), 0);
// if ossim plugins factory failed, then test ossim factory
if (!projection)
{
projection = ossimProjectionFactoryRegistry::instance()->createProjection(ossimFilename(filename), 0);
if (!projection)
{
itkGenericExceptionMacro(<< "OSSIM Instanciate projection FAILED ! ");
return EXIT_FAILURE;
}
}
hasMetaData = projection->saveState(geom_kwl);
if (!hasMetaData)
{
std::cerr << "ERROR: projection saveState return with a false flag !" << std::endl;
return EXIT_FAILURE;
}
otb::ImageKeywordlist otb_kwl;
otb_kwl.SetKeywordlist(geom_kwl);
otb_kwl.convertToOSSIMKeywordlist(geom_kwl2);
hasMetaData = projection->loadState(geom_kwl2);
if (!hasMetaData)
{
std::cerr << "ERROR: projection loadState return with a false flag !" << std::endl;
return EXIT_FAILURE;
}
hasMetaData = projection->saveState(geom_kwl3);
if (!hasMetaData)
{
std::cerr << "ERROR: projection saveState return with a false flag !" << std::endl;
return EXIT_FAILURE;
}
otb::ImageKeywordlist otb_kwl2;
otb_kwl2.SetKeywordlist(geom_kwl3);
file << "*** KEYWORD LIST ***\n";
file << otb_kwl;
file2 << "*** KEYWORD LIST ***\n";
file2 << otb_kwl2;
/** Search keyword in meter_per_pixel to truncate precision */
ossimString s;
double valueX, valueY;
otb_kwl.convertToOSSIMKeywordlist(geom_kwl2);
file << std::fixed << std::setprecision(5);
file2 << std::fixed << std::setprecision(5);
s = geom_kwl2.find("meters_per_pixel_x");
if (s != "")
{
valueX = s.toDouble();
file << "truncate_meter_per_pixel_x " << valueX << std::endl;
}
s = geom_kwl2.find("meters_per_pixel_y");
if (s != "")
{
valueY = s.toDouble();
file << "truncate_meter_per_pixel_y " << valueY << std::endl;
}
otb_kwl2.convertToOSSIMKeywordlist(geom_kwl3);
s = geom_kwl3.find("meters_per_pixel_x");
if (s != "")
{
valueX = s.toDouble();
file2 << "truncate_meter_per_pixel_x " << valueX << std::endl;
}
s = geom_kwl3.find("meters_per_pixel_y");
if (s != "")
{
valueY = s.toDouble();
file2 << "truncate_meter_per_pixel_y " << valueY << std::endl;
}
file.close();
file2.close();
return EXIT_SUCCESS;
}
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(otbImageKeywordlist);
REGISTER_TEST(otbTestImageKeywordlist);
REGISTER_TEST(otbOssimJpegFileRessourceLeakTest);
REGISTER_TEST(otbMapProjectionAdapterTest);
REGISTER_TEST(otbOssimElevManagerTest2);
......
/*=========================================================================
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.
=========================================================================*/
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
#include <otbImageKeywordlist.h>
#include <iostream>
#include <sstream>
#include <iterator>
double convertStringToDouble(const std::string& s)
{
std::istringstream i(s);
double x;
if (!(i >> x))
return 0;
return x;
}
int otbTestImageKeywordlist(int argc, char* argv[])
{
if (argc != 6)
{
std::cout << argv[0]
<< " <input img filename> <input needed keyword list> <input list of tols for each needed kw> "
<<" <output kw list filename> <bool test all kw>" << std::endl;
return EXIT_FAILURE;
}
const unsigned int Dimension = 2;
typedef double InputPixelType;
typedef otb::VectorImage<InputPixelType, Dimension> InputImageType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
const char* inputFilename = argv[1];
std::istringstream issNeededKw(argv[2]);
std::istringstream issTols(argv[3]);
char * outGeomFilename = argv[4];
bool checkAllKw = argv[5];
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFilename);
reader->UpdateOutputInformation();
otb::ImageKeywordlist kwlist = reader->GetOutput()->GetImageKeywordlist();
if (!(kwlist.GetSize() > 0))
{
std::cerr<<"Error : imageKeywordlist is empty."<<std::endl;
return EXIT_FAILURE;
}
typedef otb::ImageKeywordlist::KeywordlistMap KeywordlistMapType;
KeywordlistMapType kwmap = kwlist.GetKeywordlist();
if (checkAllKw) // Check all keywords (ignore argv[2] and argv[3])
{
// Write keywordlist, read it, compare it to the original list
WriteGeometry(kwlist,outGeomFilename);
otb::ImageKeywordlist kwlist2 = otb::ReadGeometryFromGEOMFile(outGeomFilename);
KeywordlistMapType kwmap2 = kwlist2.GetKeywordlist();
if (kwmap.size() != kwmap2.size() )
{
std::cerr << "Error : keyword lists don't have the same size (orig / reloaded): " << kwmap.size() << " / " << kwmap2.size() << std::endl;
return EXIT_FAILURE;
}
KeywordlistMapType::iterator kwlistIt = kwmap.begin();
double val1,val2;
while ( kwlistIt!=kwmap.end() )
{
val1 = convertStringToDouble(kwlistIt->second);
KeywordlistMapType::iterator it = kwmap2.find(kwlistIt->first);
if (it != kwmap2.end() )
{
val2 = convertStringToDouble(it->second);
}
else
{
std::cerr << "Error : couldn't find key " << kwlistIt->first << " in reloaded keyword list." << std::endl;
return EXIT_FAILURE;
}
if ( fabs( val2 - val1 ) > 0.01 )
{
std::cerr << "Error : orig key/value (" << kwlistIt->first << " " << kwlistIt->second << ")"<< std::endl
<< "reloaded key/value (" << kwlistIt->first << " " << kwmap2[kwlistIt->first] << ")"<< std::endl;