Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
6e306cb5
Commit
6e306cb5
authored
Jul 11, 2016
by
Rashad Kanavath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
COMP: fix compiler error on otbSamplingTestDriver
parent
563fb161
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
Modules/Learning/Sampling/test/otbImageSampleExtractorFilterTest.cxx
...rning/Sampling/test/otbImageSampleExtractorFilterTest.cxx
+15
-8
No files found.
Modules/Learning/Sampling/test/otbImageSampleExtractorFilterTest.cxx
View file @
6e306cb5
...
...
@@ -129,11 +129,9 @@ int otbImageSampleExtractorFilterUpdate(int argc, char* argv[])
otb
::
ogr
::
Layer
dstLayer
=
output
->
GetLayer
(
0
);
OGRFieldDefn
labelField
(
classFieldName
.
c_str
(),
OFTString
);
dstLayer
.
CreateField
(
labelField
,
true
);
OGRErr
err
=
dstLayer
.
ogr
().
StartTransaction
();
const
OGRErr
err
=
dstLayer
.
ogr
().
StartTransaction
();
if
(
err
!=
OGRERR_NONE
)
{
itkExceptionMacro
(
<<
"Unable to start transaction for OGR layer "
<<
dstLayer
.
ogr
().
GetName
()
<<
"."
);
}
if
(
err
==
OGRERR_NONE
)
{
otb
::
ogr
::
Layer
::
const_iterator
featIt
=
inLayer
.
begin
();
for
(;
featIt
!=
inLayer
.
end
();
++
featIt
)
...
...
@@ -143,11 +141,9 @@ int otbImageSampleExtractorFilterUpdate(int argc, char* argv[])
dstLayer
.
CreateFeature
(
dstFeature
);
}
err
=
dstLayer
.
ogr
().
CommitTransaction
();
if
(
err
!
=
OGRERR_NONE
)
const
OGRErr
err
2
=
dstLayer
.
ogr
().
CommitTransaction
();
if
(
err
2
=
=
OGRERR_NONE
)
{
itkExceptionMacro
(
<<
"Unable to commit transaction for OGR layer "
<<
dstLayer
.
ogr
().
GetName
()
<<
"."
);
}
output
->
Clear
();
...
...
@@ -175,6 +171,17 @@ int otbImageSampleExtractorFilterUpdate(int argc, char* argv[])
chrono
.
Stop
();
std
::
cout
<<
"Extraction took "
<<
chrono
.
GetTotal
()
<<
" sec"
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"Unable to commit transaction for OGR layer "
<<
dstLayer
.
ogr
().
GetName
()
<<
"."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
else
{
std
::
cout
<<
"Unable to start transaction for OGR layer "
<<
dstLayer
.
ogr
().
GetName
()
<<
"."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
return
EXIT_SUCCESS
;
}
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