Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
86710785
Commit
86710785
authored
Jun 19, 2012
by
Julien Michel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Adding a GetExtent() method to Layer
parent
fd25c4ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
+16
-0
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h
+16
-0
No files found.
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx
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"
);
...
...
Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h
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
;
...
...
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