Skip to content
Snippets Groups Projects
Commit 86d53d5b authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

DOC: add PlaceNameToLonLatExample

parent f15e3b1d
No related branches found
No related tags found
No related merge requests found
...@@ -101,7 +101,19 @@ ADD_TEST(VectorDataProjectionExampleTest ${EXE_TESTS} ...@@ -101,7 +101,19 @@ ADD_TEST(VectorDataProjectionExampleTest ${EXE_TESTS}
) )
ENDIF(OTB_DATA_USE_LARGEINPUT) ENDIF(OTB_DATA_USE_LARGEINPUT)
ADD_EXECUTABLE(otbProjectionsExamplesTests otbProjectionsExamplesTests.cxx) IF( OTB_USE_CURL )
TARGET_LINK_LIBRARIES(otbProjectionsExamplesTests gdal ITKIO ITKAlgorithms ITKStatistics ITKNumerics ITKCommon OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale OTBFusion OTBProjections) 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 ) ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
...@@ -42,12 +42,27 @@ int main( int argc, char* argv[] ) ...@@ -42,12 +42,27 @@ int main( int argc, char* argv[] )
return EXIT_FAILURE; 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 // Software Guide : BeginCodeSnippet
otb::PlaceNameToLonLat::Pointer pn2LL = otb::PlaceNameToLonLat::New(); otb::PlaceNameToLonLat::Pointer pn2LL = otb::PlaceNameToLonLat::New();
pn2LL->SetPlaceName(std::string(argv[1])); pn2LL->SetPlaceName(std::string(argv[1]));
pn2LL->Evaluate(); pn2LL->Evaluate();
// Software Guide : EndCodeSnippet // 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 // Software Guide : BeginCodeSnippet
double lon = pn2LL->GetLon(); double lon = pn2LL->GetLon();
double lat = pn2LL->GetLat(); double lat = pn2LL->GetLat();
...@@ -56,6 +71,19 @@ int main( int argc, char* argv[] ) ...@@ -56,6 +71,19 @@ int main( int argc, char* argv[] )
std::cout << "Longitude: " << lon << std::endl; std::cout << "Longitude: " << lon << std::endl;
// Software Guide : EndCodeSnippet // 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; return EXIT_SUCCESS;
} }
...@@ -29,6 +29,7 @@ void RegisterTests() ...@@ -29,6 +29,7 @@ void RegisterTests()
REGISTER_TEST(OrthoRectificationExampleTest); REGISTER_TEST(OrthoRectificationExampleTest);
REGISTER_TEST(MapProjectionExampleTest); REGISTER_TEST(MapProjectionExampleTest);
REGISTER_TEST(VectorDataProjectionExampleTest); REGISTER_TEST(VectorDataProjectionExampleTest);
REGISTER_TEST(PlaceNameToLonLatExampleTest);
} }
#undef main #undef main
...@@ -42,3 +43,7 @@ void RegisterTests() ...@@ -42,3 +43,7 @@ void RegisterTests()
#undef main #undef main
#define main VectorDataProjectionExampleTest #define main VectorDataProjectionExampleTest
#include "VectorDataProjectionExample.cxx" #include "VectorDataProjectionExample.cxx"
#undef main
#define main PlaceNameToLonLatExampleTest
#include "PlaceNameToLonLatExample.cxx"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment