Commit 86d53d5b authored by Emmanuel Christophe's avatar Emmanuel Christophe

DOC: add PlaceNameToLonLatExample

parent f15e3b1d
......@@ -101,7 +101,19 @@ ADD_TEST(VectorDataProjectionExampleTest ${EXE_TESTS}
)
ENDIF(OTB_DATA_USE_LARGEINPUT)
ADD_EXECUTABLE(otbProjectionsExamplesTests otbProjectionsExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbProjectionsExamplesTests gdal ITKIO ITKAlgorithms ITKStatistics ITKNumerics ITKCommon OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale OTBFusion OTBProjections)
IF( OTB_USE_CURL )
ADD_TEST(PlaceNameToLonLatExampleTest ${EXE_TESTS}
PlaceNameToLonLatExampleTest
Toulouse
)
ENDIF( OTB_USE_CURL )
IF( OTB_USE_CURL )
ADD_EXECUTABLE(otbProjectionsExamplesTests otbProjectionsExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbProjectionsExamplesTests OTBCommon OTBIO OTBProjections ${CURL_LIBRARY} tinyXML)
ELSE( OTB_USE_CURL )
ADD_EXECUTABLE(otbProjectionsExamplesTests otbProjectionsExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbProjectionsExamplesTests OTBCommon OTBIO OTBProjections)
ENDIF( OTB_USE_CURL )
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
......@@ -42,12 +42,27 @@ int main( int argc, char* argv[] )
return EXIT_FAILURE;
}
// Software Guide : BeginLatex
//
// You instantiate the class and pass the name you want to look for as a
// std::string to the SetPlaceName method.
//
// The call to evaluate will trigger the retrival process.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
otb::PlaceNameToLonLat::Pointer pn2LL = otb::PlaceNameToLonLat::New();
pn2LL->SetPlaceName(std::string(argv[1]));
pn2LL->Evaluate();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// To get the data, you can simply call the GetLon and GetLat methods.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
double lon = pn2LL->GetLon();
double lat = pn2LL->GetLat();
......@@ -56,6 +71,19 @@ int main( int argc, char* argv[] )
std::cout << "Longitude: " << lon << std::endl;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// If you tried with a string such as "Toulouse", you should obtain something
// like:
//
// \begin{verbatim}
// Latitude: 43.6044
// Longitude: 1.44295
// \end{verbatim}
//
// Software Guide : EndLatex
return EXIT_SUCCESS;
}
......@@ -29,6 +29,7 @@ void RegisterTests()
REGISTER_TEST(OrthoRectificationExampleTest);
REGISTER_TEST(MapProjectionExampleTest);
REGISTER_TEST(VectorDataProjectionExampleTest);
REGISTER_TEST(PlaceNameToLonLatExampleTest);
}
#undef main
......@@ -42,3 +43,7 @@ void RegisterTests()
#undef main
#define main VectorDataProjectionExampleTest
#include "VectorDataProjectionExample.cxx"
#undef main
#define main PlaceNameToLonLatExampleTest
#include "PlaceNameToLonLatExample.cxx"
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