Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
bd849139
Commit
bd849139
authored
Jan 09, 2010
by
Manuel Grizonnet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DOC:add simple geospatial example
parent
8a8099e9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
295 additions
and
2 deletions
+295
-2
Examples/CMakeLists.txt
Examples/CMakeLists.txt
+9
-1
Examples/GeospatialAnalysis/CMakeLists.txt
Examples/GeospatialAnalysis/CMakeLists.txt
+41
-0
Examples/GeospatialAnalysis/CMakeLists.txt~
Examples/GeospatialAnalysis/CMakeLists.txt~
+41
-0
Examples/GeospatialAnalysis/PostGISCreateTable.cxx
Examples/GeospatialAnalysis/PostGISCreateTable.cxx
+68
-0
Examples/GeospatialAnalysis/PostGISCreateTable.cxx~
Examples/GeospatialAnalysis/PostGISCreateTable.cxx~
+68
-0
Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx
...GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx
+34
-0
Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~
...eospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~
+34
-0
Examples/OBIA/LabelMapToVectorData.cxx
Examples/OBIA/LabelMapToVectorData.cxx
+0
-1
No files found.
Examples/CMakeLists.txt
View file @
bd849139
...
...
@@ -35,6 +35,10 @@ IF(OTB_USE_PATENTED)
ADD_SUBDIRECTORY
(
Patented
)
ENDIF
(
OTB_USE_PATENTED
)
IF
(
OTB_USE_PQXX
)
ADD_SUBDIRECTORY
(
GeospatialAnalysis
)
ENDIF
(
OTB_USE_PQXX
)
#Recopie du fichier README.txt dans l'arborescence BINARY
IF
(
EXISTS
${
OTB_BINARY_DIR
}
/Examples/README.txt
)
ELSE
(
EXISTS
${
OTB_BINARY_DIR
}
/Examples/README.txt
)
...
...
@@ -81,7 +85,7 @@ ELSE(OTB_BINARY_DIR)
ADD_SUBDIRECTORY
(
Fusion
)
ADD_SUBDIRECTORY
(
Tutorials
)
ADD_SUBDIRECTORY
(
Markov
)
ADD_SUBDIRECTORY
(
OBIA
)
ADD_SUBDIRECTORY
(
OBIA
)
IF
(
OTB_USE_VISU_GUI
)
ADD_SUBDIRECTORY
(
Visu
)
...
...
@@ -90,6 +94,10 @@ ELSE(OTB_BINARY_DIR)
IF
(
OTB_USE_PATENTED
)
ADD_SUBDIRECTORY
(
Patented
)
ENDIF
(
OTB_USE_PATENTED
)
IF
(
OTB_USE_PQXX
)
ADD_SUBDIRECTORY
(
GeospatialAnalysis
)
ENDIF
(
OTB_USE_PQXX
)
ELSE
(
OTB_FOUND
)
MESSAGE
(
"OTB not found. Please set OTB_DIR"
)
ENDIF
(
OTB_FOUND
)
...
...
Examples/GeospatialAnalysis/CMakeLists.txt
0 → 100644
View file @
bd849139
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 OTBIO OTBGeospatialAnalysis OTBTesting
)
ENDIF
(
NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING
)
Examples/GeospatialAnalysis/CMakeLists.txt~
0 → 100644
View file @
bd849139
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 )
Examples/GeospatialAnalysis/PostGISCreateTable.cxx
0 → 100644
View file @
bd849139
/*=========================================================================
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.
=========================================================================*/
#include "itkExceptionObject.h"
#include "otbMacro.h"
#include "otbPostGISCreateTableTransactor.h"
#include "otbPostGISConnectionImplementation.h"
/** 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
*/
int
main
(
int
argc
,
char
*
argv
[])
{
typedef
otb
::
PostGISCreateTableTransactor
TransactorType
;
//Instantiation
TransactorType
myTransactor
;
unsigned
short
dimension
=
2
;
myTransactor
.
SetDimension
(
dimension
);
std
::
string
name
=
"mytable"
;
myTransactor
.
SetTableName
(
name
);
int
srid
=
-
1
;
myTransactor
.
SetSRID
(
srid
);
myTransactor
.
SetRemoveExistingTable
(
true
);
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
;
//Instantiation
GISConnectionType
::
Pointer
connection
=
GISConnectionType
::
New
();
connection
->
SetHost
(
hostName
);
connection
->
SetDBName
(
dbName
);
connection
->
SetUser
(
userName
);
connection
->
SetPassword
(
userPassword
);
connection
->
ConnectToDB
();
connection
->
PerformTransaction
(
myTransactor
);
return
EXIT_SUCCESS
;
}
Examples/GeospatialAnalysis/PostGISCreateTable.cxx~
0 → 100644
View file @
bd849139
/*=========================================================================
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.
=========================================================================*/
#include "itkExceptionObject.h"
#include "otbMacro.h"
#include "otbPostGISCreateTableTransactor.h"
#include "otbPostGISConnectionImplementation.h"
/** 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
*/
int otbPostGISCreateTableTransactorCreate(int argc, char * argv[])
{
typedef otb::PostGISCreateTableTransactor TransactorType;
//Instantiation
TransactorType myTransactor;
unsigned short dimension = 2;
myTransactor.SetDimension( dimension );
std::string name = "mytable";
myTransactor.SetTableName( name );
int srid = -1;
myTransactor.SetSRID( srid );
myTransactor.SetRemoveExistingTable( true );
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;
//Instantiation
GISConnectionType::Pointer connection = GISConnectionType::New();
connection->SetHost( hostName );
connection->SetDBName( dbName );
connection->SetUser( userName );
connection->SetPassword( userPassword );
connection->ConnectToDB();
connection->PerformTransaction( myTransactor );
return EXIT_SUCCESS;
}
Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx
0 → 100644
View file @
bd849139
/*=========================================================================
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"
Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~
0 → 100644
View file @
bd849139
/*=========================================================================
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 OBIAImageToLabelToImageTest
#include "PostGISCreateTable.cxx"
Examples/OBIA/LabelMapToVectorData.cxx
View file @
bd849139
...
...
@@ -42,7 +42,6 @@
#include <fstream>
#include <iostream>
#include "otbImage.h"
#include "otbLabelMapToVectorDataFilter.h"
#include "otbAttributesMapLabelObject.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment