diff --git a/Examples/Projections/CMakeLists.txt b/Examples/Projections/CMakeLists.txt index f09d0e73f34096bdbd155ff7da5482efbb033378..cb57a1f404d92ef9af05e68451d8f512f772620f 100644 --- a/Examples/Projections/CMakeLists.txt +++ b/Examples/Projections/CMakeLists.txt @@ -15,6 +15,9 @@ SET(PROJECTIONS_EXAMPLES ${CXX_TEST_PATH}/otbProjectionsExamplesTests) ADD_EXECUTABLE(SensorModelExample SensorModelExample.cxx ) TARGET_LINK_LIBRARIES(SensorModelExample OTBProjections OTBCommon OTBIO ITKCommon ITKIO) +ADD_EXECUTABLE(MapProjectionExample MapProjectionExample.cxx ) +TARGET_LINK_LIBRARIES(MapProjectionExample OTBProjections OTBCommon OTBIO) + ADD_EXECUTABLE(OrthoRectificationExample OrthoRectificationExample.cxx ) TARGET_LINK_LIBRARIES(OrthoRectificationExample OTBProjections OTBCommon OTBIO ITKCommon ITKIO) diff --git a/Examples/Projections/MapProjectionExample.cxx b/Examples/Projections/MapProjectionExample.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d162c0cf0991f5038b7920ca52fdf0366885c946 --- /dev/null +++ b/Examples/Projections/MapProjectionExample.cxx @@ -0,0 +1,47 @@ +/*========================================================================= + + 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. + +=========================================================================*/ +#if defined(_MSC_VER) +#pragma warning ( disable : 4786 ) +#endif + +#include "otbMapProjections.h" + +int main( int argc, char* argv[] ) +{ + if(argc < 3 ) + { + std::cout << argv[0] <<" <lon> <lat> <outputfile>" << std::endl; + + return EXIT_FAILURE; + } + + double lon = atof(argv[1]); + double lat = atof(argv[2]); + const char * outFileName = argv[3]; + + std::ofstream file; + file.open(outFileName); + file << std::setprecision(15); + + otb::UtmForwardProjection::Pointer lUtmProjection = otb::UtmForwardProjection::New(); + + + + + return EXIT_SUCCESS; +}