From 92306219b5b42ffae10f257c4b163bc7e69b4144 Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Tue, 13 Jan 2009 17:42:20 +0800 Subject: [PATCH] DOC: add MapProjectionExample --- Examples/Projections/CMakeLists.txt | 3 ++ Examples/Projections/MapProjectionExample.cxx | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Examples/Projections/MapProjectionExample.cxx diff --git a/Examples/Projections/CMakeLists.txt b/Examples/Projections/CMakeLists.txt index f09d0e73f3..cb57a1f404 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 0000000000..d162c0cf09 --- /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; +} -- GitLab