Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
212
Issues
212
List
Boards
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
edb9d609
Commit
edb9d609
authored
Jun 19, 2012
by
Julien Michel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Adding a GetGlobalExtent() method to DataSource
parent
86710785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
...UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+42
-0
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
+17
-0
No files found.
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
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
...
...
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
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.
...
...
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