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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
David Youssefi
otb
Commits
edb9d609
Commit
edb9d609
authored
12 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding a GetGlobalExtent() method to DataSource
parent
86710785
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+42
-0
42 additions, 0 deletions
...UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
+17
-0
17 additions, 0 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
with
59 additions
and
0 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+
42
−
0
View file @
edb9d609
...
...
@@ -402,6 +402,48 @@ int otb::ogr::DataSource::Size(bool doForceComputation) const
/*=================================[ Misc ]==================================*/
/*===========================================================================*/
void
otb
::
ogr
::
DataSource
::
GetGlobalExtent
(
double
&
ulx
,
double
&
uly
,
double
&
lrx
,
double
&
lry
,
bool
force
)
const
{
OGREnvelope
sExtent
;
const_iterator
lit
=
this
->
begin
();
const
OGRErr
res
=
lit
->
ogr
().
GetExtent
(
&
sExtent
,
force
);
if
(
res
!=
OGRERR_NONE
)
{
itkGenericExceptionMacro
(
<<
"Cannot retrieve extent of layer <"
<<
lit
->
GetName
()
<<
">: "
<<
CPLGetLastErrorMsg
());
}
++
lit
;
for
(;
lit
!=
this
->
end
();
++
lit
)
{
OGREnvelope
cExtent
;
const
OGRErr
cres
=
lit
->
ogr
().
GetExtent
(
&
cExtent
,
force
);
if
(
cres
!=
OGRERR_NONE
)
{
itkGenericExceptionMacro
(
<<
"Cannot retrieve extent of layer <"
<<
lit
->
GetName
()
<<
">: "
<<
CPLGetLastErrorMsg
());
}
// Merge with previous layer
sExtent
.
Merge
(
cExtent
);
}
ulx
=
sExtent
.
MinX
;
uly
=
sExtent
.
MinY
;
lrx
=
sExtent
.
MaxX
;
lry
=
sExtent
.
MaxY
;
}
/*virtual*/
void
otb
::
ogr
::
DataSource
::
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
...
...
This diff is collapsed.
Click to expand it.
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
+
17
−
0
View file @
edb9d609
...
...
@@ -212,6 +212,23 @@ public:
*/
int
Size
(
bool
doForceComputation
)
const
;
/** Allow to retrieve the union of the extents of all layers
* \param[out] ulx reference to upper-left x coordinate of the
* extent
* \param[out] uly reference to upper-left y coordinate of the
* extent
* \param[out] lrx reference to lower-right x coordinate of the
* extent
* \param[out] uly reference to lower-right y coordinate of the
* extent
* \param[in] force Force computation of layers extents if not
* available. May force the driver to walk all geometries to
* compute the extent.
* \throw itk::ExceptionObject if the layers extents can not be retrieved.
*/
void
GetGlobalExtent
(
double
&
ulx
,
double
&
uly
,
double
&
lrx
,
double
&
lry
,
bool
force
=
false
)
const
;
/** Grafts data and information from one data source to another.
* \deprecated \c OGRLayer has an embedded input iterator. As a consequence,
* the layer cannot support multiple access to its elements.
...
...
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