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
David Youssefi
otb
Commits
3cd0f3e5
Commit
3cd0f3e5
authored
Jul 08, 2020
by
Julien Osman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX: Update the test with the new API
parent
a37eb1ca
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
7 deletions
+19
-7
Modules/Core/Metadata/include/otbMetadataSupplierInterface.h
Modules/Core/Metadata/include/otbMetadataSupplierInterface.h
+2
-0
Modules/Core/Metadata/include/otbXMLMetadataSupplier.h
Modules/Core/Metadata/include/otbXMLMetadataSupplier.h
+2
-0
Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx
.../Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx
+1
-1
Modules/Core/Metadata/src/otbXMLMetadataSupplier.cxx
Modules/Core/Metadata/src/otbXMLMetadataSupplier.cxx
+6
-1
Modules/Core/Metadata/test/otbImageMetadataInterfaceTest.cxx
Modules/Core/Metadata/test/otbImageMetadataInterfaceTest.cxx
+0
-2
Modules/Core/Metadata/test/otbXMLMetadataSupplierTest.cxx
Modules/Core/Metadata/test/otbXMLMetadataSupplierTest.cxx
+3
-2
Modules/IO/IOGDAL/include/otbGDALImageIO.h
Modules/IO/IOGDAL/include/otbGDALImageIO.h
+1
-1
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
+4
-0
No files found.
Modules/Core/Metadata/include/otbMetadataSupplierInterface.h
View file @
3cd0f3e5
...
...
@@ -81,6 +81,8 @@ public:
bool
HasValue
(
std
::
string
path
,
int
band
=-
1
);
virtual
int
GetNbBands
()
const
=
0
;
// utility functions
template
<
typename
T
>
T
GetAs
(
std
::
string
path
,
int
band
=-
1
)
const
{
...
...
Modules/Core/Metadata/include/otbXMLMetadataSupplier.h
View file @
3cd0f3e5
...
...
@@ -51,6 +51,8 @@ public:
std
::
string
GetResourceFile
(
std
::
string
=
""
)
const
override
;
int
GetNbBands
()
const
override
;
std
::
string
PrintSelf
();
protected:
...
...
Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx
View file @
3cd0f3e5
...
...
@@ -403,7 +403,7 @@ std::vector<OTB_calibrationVector> Sentinel1ImageMetadataInterface::GetCalibrati
void
Sentinel1ImageMetadataInterface
::
Parse
(
const
MetadataSupplierInterface
*
mds
)
{
assert
(
mds
);
assert
(
mds
->
GetNbBands
()
==
this
->
m_Imd
.
GetNb
Bands
());
assert
(
mds
->
GetNbBands
()
==
this
->
m_Imd
.
Bands
.
size
());
// Metadata read by GDAL
//Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
//Fetch(MDTime::AcquisitionStopTime, mds, "ACQUISITION_STOP_TIME");
...
...
Modules/Core/Metadata/src/otbXMLMetadataSupplier.cxx
View file @
3cd0f3e5
...
...
@@ -43,7 +43,7 @@ XMLMetadataSupplier::XMLMetadataSupplier(const std::string & fileName)
const
std
::
string
XMLMetadataSupplier
::
GetMetadataValue
(
const
std
::
string
path
,
bool
&
hasValue
,
int
band
)
const
{
const
char
*
ret
=
CSLFetchNameValue
(
m_MetadataDic
,
path
);
const
char
*
ret
=
CSLFetchNameValue
(
m_MetadataDic
,
path
.
c_str
()
);
if
(
ret
)
hasValue
=
true
;
else
...
...
@@ -165,6 +165,11 @@ char** XMLMetadataSupplier::ReadXMLToList(CPLXMLNode* psNode, char** papszList,
return
papszList
;
}
int
XMLMetadataSupplier
::
GetNbBands
()
const
{
return
0
;
}
std
::
string
XMLMetadataSupplier
::
PrintSelf
()
{
std
::
ostringstream
oss
;
...
...
Modules/Core/Metadata/test/otbImageMetadataInterfaceTest.cxx
View file @
3cd0f3e5
...
...
@@ -59,7 +59,5 @@ int otbImageMetadataInterfaceTest(int itkNotUsed(argc), char* argv[])
file
<<
boost
::
any_cast
<
otb
::
Projection
::
GCPParam
>
(
imd2
[
otb
::
MDGeom
::
GCP
]).
ToJSON
(
true
);
file
.
close
();
std
::
cout
<<
mds2
->
printSomething
()
<<
std
::
endl
;;
return
EXIT_SUCCESS
;
}
Modules/Core/Metadata/test/otbXMLMetadataSupplierTest.cxx
View file @
3cd0f3e5
...
...
@@ -27,10 +27,11 @@ int otbXMLMetadataSupplierTest(int itkNotUsed(argc), char* argv[])
const
char
*
outputFilename
=
argv
[
2
];
otb
::
XMLMetadataSupplier
mds
(
fileName
);
bool
hasValue
;
std
::
ofstream
file
;
file
.
open
(
outputFilename
);
file
<<
mds
.
GetMetadataValue
(
"OTB.application.name"
)
<<
"
\n
"
;
file
<<
mds
.
GetMetadataValue
(
"OTB.application.parameter_3.name"
)
<<
"
\n
"
;
file
<<
mds
.
GetMetadataValue
(
"OTB.application.name"
,
hasValue
)
<<
"
\n
"
;
file
<<
mds
.
GetMetadataValue
(
"OTB.application.parameter_3.name"
,
hasValue
)
<<
"
\n
"
;
file
.
close
();
return
EXIT_SUCCESS
;
...
...
Modules/IO/IOGDAL/include/otbGDALImageIO.h
View file @
3cd0f3e5
...
...
@@ -201,7 +201,7 @@ public:
/** Returns gdal pixel type as string */
std
::
string
GetGdalPixelTypeAsString
()
const
;
i
tkGetMacro
(
NbBands
,
int
)
;
i
nt
GetNbBands
()
const
override
;
// MetadataSupplierInterface overrides
...
...
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
View file @
3cd0f3e5
...
...
@@ -1808,6 +1808,10 @@ std::string GDALImageIO::GetGdalPixelTypeAsString() const
return
name
;
}
int
GDALImageIO
::
GetNbBands
()
const
{
return
m_Dataset
->
GetDataSet
()
->
GetRasterCount
();
}
std
::
string
GDALImageIO
::
GetResourceFile
(
std
::
string
str
)
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