Skip to content
Snippets Groups Projects
Commit f6ea5b55 authored by Julien Osman's avatar Julien Osman
Browse files

FIX: Apply corrections to the Fetch methods

Add a new Fetch method for the Extra metadata. And
the other Fetch methods had an issue with fetching the
metadata for the bands.
parent ff17a68f
No related branches found
No related tags found
No related merge requests found
......@@ -219,6 +219,8 @@ public:
const MetaData::Time& Fetch(MDTime key, const MetadataSupplierInterface * mds, const char *path, int band=-1);
const std::string& Fetch(std::string key, const MetadataSupplierInterface * mds, const char *path, int band=-1);
const boost::any& FetchRPC(const MetadataSupplierInterface * mds);
/** Reads into the MetaDataDictionary to find an OSSIM ImageKeywordlist,
......
......@@ -630,7 +630,7 @@ ImageMetadataInterfaceBase::Fetch(
if (band >= 0)
{
assert( (size_t)(band) < m_Imd.Bands.size());
m_Imd.Bands[band].Add(key, mds->GetAs<std::string>(path));
m_Imd.Bands[band].Add(key, mds->GetAs<std::string>(path, band));
return m_Imd.Bands[band][key];
}
m_Imd.Add(key, mds->GetAs<std::string>(path) );
......@@ -647,7 +647,7 @@ ImageMetadataInterfaceBase::Fetch(
if (band >= 0)
{
assert( (size_t)(band) < m_Imd.Bands.size());
m_Imd.Bands[band].Add(key, mds->GetAs<double>(path));
m_Imd.Bands[band].Add(key, mds->GetAs<double>(path, band));
return m_Imd.Bands[band][key];
}
m_Imd.Add(key, mds->GetAs<double>(path));
......@@ -664,13 +664,30 @@ ImageMetadataInterfaceBase::Fetch(
if (band >= 0)
{
assert( (size_t)(band) < m_Imd.Bands.size());
m_Imd.Bands[band].Add(key, mds->GetAs<MetaData::Time>(path));
m_Imd.Bands[band].Add(key, mds->GetAs<MetaData::Time>(path, band));
return m_Imd.Bands[band][key];
}
m_Imd.Add(key, mds->GetAs<MetaData::Time>(path));
return m_Imd[key];
}
const std::string&
ImageMetadataInterfaceBase::Fetch(
std::string key,
const MetadataSupplierInterface * mds,
const char *path,
int band)
{
if (band >= 0)
{
assert( (size_t)(band) < m_Imd.Bands.size());
m_Imd.Bands[band].Add(key, mds->GetAs<std::string>(path, band));
return m_Imd.Bands[band][key];
}
m_Imd.Add(key, mds->GetAs<std::string>(path) );
return m_Imd[key];
}
const boost::any& ImageMetadataInterfaceBase::FetchRPC(
const MetadataSupplierInterface * mds)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment