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
86710785
Commit
86710785
authored
12 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding a GetExtent() method to Layer
parent
fd25c4ab
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/otbOGRLayerWrapper.cxx
+16
-0
16 additions, 0 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h
+16
-0
16 additions, 0 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h
with
32 additions
and
0 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
+
16
−
0
View file @
86710785
...
...
@@ -158,6 +158,22 @@ std::string otb::ogr::Layer::GetName() const
#endif
}
void
otb
::
ogr
::
Layer
::
GetExtent
(
double
&
ulx
,
double
&
uly
,
double
&
lrx
,
double
&
lry
,
bool
force
)
const
{
OGREnvelope
sExtent
;
const
OGRErr
res
=
m_Layer
->
GetExtent
(
&
sExtent
,
force
);
if
(
res
!=
OGRERR_NONE
)
{
itkGenericExceptionMacro
(
<<
"Cannot retrieve extent of layer <"
<<
GetName
()
<<
">: "
<<
CPLGetLastErrorMsg
());
}
ulx
=
sExtent
.
MinX
;
uly
=
sExtent
.
MinY
;
lrx
=
sExtent
.
MaxX
;
lry
=
sExtent
.
MaxY
;
}
OGRLayer
&
otb
::
ogr
::
Layer
::
ogr
()
{
assert
(
m_Layer
&&
"OGRLayer not initialized"
);
...
...
This diff is collapsed.
Click to expand it.
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h
+
16
−
0
View file @
86710785
...
...
@@ -189,6 +189,22 @@ public:
*/
std
::
string
GetName
()
const
;
/** Allow to retrieve the extent of the layer
* \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 the extent if not
* available. May force the driver to walk all geometries to
* compute the extent.
* \throw itk::ExceptionObject if the extent can not be retrieved.
*/
void
GetExtent
(
double
&
ulx
,
double
&
uly
,
double
&
lrx
,
double
&
lry
,
bool
force
=
false
)
const
;
/** Prints self into stream. */
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
;
...
...
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