Commit f57e9178 authored by Sébastien Dinot's avatar Sébastien Dinot

WRG: Remove backup copy of source files

parent eebde039
PROJECT(GeospatialAnalysisExamples)
INCLUDE_REGULAR_EXPRESSION("^.*$")
ADD_EXECUTABLE(PostGISCreateTable PostGISCreateTable.cxx )
TARGET_LINK_LIBRARIES(PostGISCreateTable OTBCommon OTBIO OTBGeospatialAnalysis ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
SET(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/GeospatialAnalysis)
SET(INPUTDATA ${OTB_DATA_ROOT}/Examples)
#Remote sensing images (large images )
IF(OTB_DATA_USE_LARGEINPUT)
SET(INPUTLARGEDATA ${OTB_DATA_LARGEINPUT_ROOT} )
ENDIF(OTB_DATA_USE_LARGEINPUT)
SET(TEMP ${OTB_BINARY_DIR}/Testing/Temporary)
SET(EXE_TESTS ${CXX_TEST_PATH}/otbGeospatialAnalysisExamplesTests)
SET(TOL 0.0)
SET(EPS 0.001)
ADD_TEST( trTeGeospatialAnalysisPostGISCreateTableTest ${EXE_TESTS}
GeospatialAnalysisPostGISCreateTableTest
localhost
orfeotoolbox_test
orfeotoolbox_test_user
Bidfeud0
)
INCLUDE_DIRECTORIES(${OTB_SOURCE_DIR}/Testing/Code)
ADD_EXECUTABLE(otbGeospatialAnalysisExamplesTests otbGeospatialAnalysisExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbGeospatialAnalysisExamplesTests OTBCommon OTBDisparityMap OTBIO OTBGeospatialAnalysis OTBTesting)
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
/*=========================================================================
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.
=========================================================================*/
// Software Guide : BeginLatex
//
// This test uses a transactor to create a table. The transactor
// needs to have a copy constructor, so the initialization is done
// correctly for the class variables which are set before the transaction.
// Let's look at the minimal code required to use this algorithm. First, the
// following header defining the \doxygen{otb}{PostGISCreateTableTransactor} class
// must be included.
// Software Guide : EndLatex
#include "itkExceptionObject.h"
#include "otbMacro.h"
// Software Guide : BeginCodeSnippet
#include "otbPostGISCreateTableTransactor.h"
#include "otbPostGISConnectionImplementation.h"
// Software Guide : EndCodeSnippet
int main(int argc, char * argv[])
{
// Software Guide : BeginLatex
//
// Instanciation of the PQXX-based transactor
// for creating PostGIS tables.
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::PostGISCreateTableTransactor TransactorType;
TransactorType myTransactor;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Set arguments of the transactor
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
unsigned short dimension = 2;
myTransactor.SetDimension( dimension );
std::string name = "mytable";
myTransactor.SetTableName( name );
int srid = -1;
myTransactor.SetSRID( srid );
myTransactor.SetRemoveExistingTable( true );
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// After defining the transcator, we need to create the
// connection interface to the PostgreSQL database.
// This is done by the \doxygen{otb}{PostGISConnectionImplementation}.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
const std::string hostName = argv[1];
const std::string dbName = argv[2];
const std::string userName = argv[3];
const std::string userPassword = argv[4];
typedef otb::PostGISConnectionImplementation GISConnectionType;
GISConnectionType::Pointer connection = GISConnectionType::New();
connection->SetHost( hostName );
connection->SetDBName( dbName );
connection->SetUser( userName );
connection->SetPassword( userPassword );
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Let's now connect to the database and perform the transaction
// with the method \code{PerformTransaction}.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
connection->ConnectToDB();
connection->PerformTransaction( myTransactor );
// Software Guide : EndCodeSnippet
return EXIT_SUCCESS;
}
/*=========================================================================
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.
=========================================================================*/
// this file defines the otbMultiScaleTest for the test driver
// and all it expects is that you have a function called RegisterTests
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include <iostream>
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(GeospatialAnalysisPostGISCreateTableTest);
}
#undef main
#define main GeospatialAnalysisPostGISCreateTableTest
#include "PostGISCreateTable.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