Commit 3ad1c0f0 authored by Julien Osman's avatar Julien Osman

TEST: Add case with DEM

parent 3d4b262a
Pipeline #6327 passed with stages
in 73 minutes and 42 seconds
Testing geopoint: [1.4434869, 43.604688]
Testing InverseSensorModel: [1.4434869, 43.604688] -> [11234.024, 8199.2289]
Testing ForwardSensorModel: [11234.024, 8199.2289] -> [1.4434838, 43.604235]
......@@ -84,6 +84,18 @@ otb_add_test(NAME prTvTestCreateInverseForwardSensorModel_Toulouse COMMAND otbTr
43.60468837
)
otb_add_test(NAME prTvTestCreateInverseForwardSensorModel_DEM COMMAND otbTransformTestDriver
--compare-ascii ${EPSILON_4}
${BASELINE_FILES}/prTvTestCreateInverseForwardSensorModel_DEM.txt
${TEMP}/prTvTestCreateInverseForwardSensorModel_DEM.txt
otbCreateInverseForwardSensorModel
LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
${TEMP}/prTvTestCreateInverseForwardSensorModel_DEM.txt
1.44348693
43.60468837
${INPUTDATA}/DEM/srtm_directory/N43E001.hgt
)
otb_add_test(NAME prTvTestCreateProjectionWithOSSIM_Cevennes COMMAND otbTransformTestDriver
otbCreateProjectionWithOSSIM
LARGEINPUT{QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF}
......
......@@ -30,12 +30,24 @@
#include "otbInverseSensorModel.h"
#include "otbForwardSensorModel.h"
#include "otbDEMHandler.h"
int otbCreateInverseForwardSensorModel(int argc, char* argv[])
{
if (argc != 5)
std::string InputFilename, OutputFilename, pointX, pointY;
switch (argc)
{
std::cout << argv[0] << " <input filename> <output filename> <test_point_X> <test_point_Y>\n";
case 6 :
otb::DEMHandler::GetInstance().OpenDEMFile(argv[5]);
case 5 :
InputFilename = argv[1];
OutputFilename = argv[2];
pointX = argv[3];
pointY = argv[4];
break;
default :
std::cout << argv[0] << " <input filename> <output filename> <test_point_X> <test_point_Y> [optional DEM path]\n";
return EXIT_FAILURE;
}
......@@ -50,7 +62,7 @@ int otbCreateInverseForwardSensorModel(int argc, char* argv[])
ReaderType::Pointer reader = ReaderType::New();
// Set parameters ...
reader->SetFileName(argv[1]);
reader->SetFileName(InputFilename);
// Read meta data (ossimKeywordlist)
reader->GenerateOutputInformation();
......@@ -72,12 +84,12 @@ int otbCreateInverseForwardSensorModel(int argc, char* argv[])
return EXIT_FAILURE;
}
std::ofstream ofs(argv[2], std::ofstream::out);
std::ofstream ofs(OutputFilename, std::ofstream::out);
ofs.precision(8);
InverseModelType::InputPointType geoPoint;
geoPoint[0] = atof(argv[3]);
geoPoint[1] = atof(argv[4]);
geoPoint[0] = atof(pointX.c_str());
geoPoint[1] = atof(pointY.c_str());
ofs << "Testing geopoint: " << geoPoint << "\n\n";
......
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