Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
678e7d59
Commit
678e7d59
authored
15 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
ENH: WIP for GISConnection
parent
ad9a4d5f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Common/otbGISConnection.cxx
+84
-0
84 additions, 0 deletions
Code/Common/otbGISConnection.cxx
with
84 additions
and
0 deletions
Code/Common/otbGISConnection.cxx
0 → 100644
+
84
−
0
View file @
678e7d59
/*=========================================================================
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.
=========================================================================*/
#ifndef __otbGISConnection_txx
#define __otbGISConnection_txx
#include
"otbGISConnection.h"
#include
<sstream>
namespace
otb
{
GISConnection
::
GISConnection
()
{
m_Host
=
"localhost"
;
m_DBName
=
""
;
m_User
=
"postgres"
;
m_Password
=
""
;
m_Port
=
""
;
m_Options
""
;
m_PostGISConnection
=
new
BasicConnectionType
();
}
GISConnection
::~
GISConnection
()
{
delete
m_PostGISConnection
;
}
void
GISConnection
::
ConnectToDB
()
{
std
::
stringstream
connstring
;
connstring
<<
"host="
<<
m_Host
<<
" dbname="
<<
m_DBName
<<
" user="
<<
m_User
;
if
(
m_Password
!=
""
)
connstring
<<
" password="
<<
m_Password
;
if
(
m_Port
!=
""
)
connstring
<<
" port="
<<
m_Port
;
if
(
m_Options
!=
""
)
connstring
<<
" options="
<<
m_Options
;
delete
m_PostGISConnection
;
m_PostGISConnection
=
new
=
BasicConnectionType
(
connstring
.
str
().
c_str
());
}
void
GISConnection
::
PerformTransaction
(
const
TransactorType
&
theTransaction
)
{
m_PostGISConnection
.
perform
(
theTransaction
()
);
}
void
GISConnection
::
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
{
Superclass
::
PrintSelf
(
os
,
indent
);
os
<<
std
::
endl
;
os
<<
"DB name: "
<<
m_DBName
<<
std
::
endl
;
}
}
}
// end namespace otb
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment