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
9ee7056b
Commit
9ee7056b
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
BUG: problems when reading HDF file with subdatasets, MODIS for eg. (bug exporation commit)
parent
8e267649
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/IO/otbGDALImageIO.cxx
+29
-10
29 additions, 10 deletions
Code/IO/otbGDALImageIO.cxx
with
29 additions
and
10 deletions
Code/IO/otbGDALImageIO.cxx
+
29
−
10
View file @
9ee7056b
...
...
@@ -281,14 +281,6 @@ namespace otb
itkExceptionMacro
(
<<
"GDAl read : empty image file name file."
);
}
// Recupre le nom r�el du fichier a ouvrir
/* std::string lFileNameGdal;
bool found = GetGdalReadImageFileName(m_FileName.c_str(),lFileNameGdal);
if( found == false )
{
itkExceptionMacro(<<"The file "<<m_FileName<<" is not supported by GDAL !!!");
}
*/
std
::
string
lFileNameGdal
=
m_FileName
;
// Init GDAL parameters
...
...
@@ -327,6 +319,33 @@ namespace otb
// Get Number of Bands
m_NbBands
=
m_poDataset
->
GetRasterCount
();
if
(
m_NbBands
==
0
)
{
//FIXME this happen in the case of a hdf file with SUBDATASETS
// in this situation, at least the first dataset should be open (ideally all in an imagelist)
// char** papszMetadata;
// papszMetadata = m_poDataset->GetMetadata("SUBDATASETS");
// if( CSLCount(papszMetadata) > 0 )
// {
// std::string key;
// itk::MetaDataDictionary & dico = this->GetMetaDataDictionary();
// for( int cpt = 0; papszMetadata[cpt] != NULL; cpt++ )
// {
// std::cout << papszMetadata[cpt] << std::endl;
// ::itk::OStringStream lStream;
// lStream << MetaDataKey::m_SubMetadataKey << cpt;
// key = lStream.str();
//
// itk::EncapsulateMetaData<std::string>(dico, key,
// static_cast<std::string>( papszMetadata[cpt] ) );
// }
// std::cout << dico[dico.GetKeys()[0]] << std::endl;
// std::cout << key << std::endl;
// }
itkExceptionMacro
(
<<
"Zero band found in the dataset"
);
return
;
}
this
->
SetNumberOfComponents
(
m_NbBands
);
otbMsgDevMacro
(
<<
"NbBands : "
<<
m_NbBands
);
...
...
@@ -344,7 +363,7 @@ namespace otb
m_poBands
=
new
GDALRasterBand
*
[
m_NbBands
];
if
(
m_poBands
==
NULL
)
{
itkExceptionMacro
(
<<
"
Erreur d'
allocation
memoire du
'rasterBands'"
);
itkExceptionMacro
(
<<
"
Memory
allocation
error for the
'rasterBands'"
);
return
;
}
for
(
i
=
0
;
i
<
m_NbBands
;
i
++
)
...
...
@@ -389,7 +408,7 @@ namespace otb
}
else
{
itkExceptionMacro
(
<<
"
Type de codage des pixels non reconu
"
);
itkExceptionMacro
(
<<
"
Pixel type unknown
"
);
}
...
...
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