Commit 24b0532b authored by Cédric Traizet's avatar Cédric Traizet

ENH: code review

parent 3e3a0c44
Pipeline #6008 failed with stages
in 98 minutes and 23 seconds
......@@ -1337,6 +1337,7 @@ void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
if (file.find("METADATA.DIM")!=std::string::npos)
{
metadataFile = file;
break;
}
}
......@@ -1355,11 +1356,6 @@ void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
auto nbBands = m_Imd.Bands.size();
std::cout << nbBands << " " << dimapData.PhysicalBias.size() << " "
<< dimapData.SolarIrradiance.size() << " " << dimapData.PhysicalGain.size() << " "
<< dimapData.BandIDs.size() << std::endl;
// Band names are not in the metadata. Two cases should be considered
// here: panchromatic and multispectral
if (nbBands == 1)
......@@ -1388,8 +1384,6 @@ void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
{
FetchRPC(*mds);
}
std::cout << m_Imd << std::endl;
}
......
......@@ -700,15 +700,14 @@ const boost::any& ImageMetadataInterfaceBase::FetchRPC(
auto GetMetadataWithoutUnit = [](const std::string & path,
const MetadataSupplierInterface & mds)
{
const std::vector<std::string> unitNames = {"meters", "degrees", "pixels"};
auto metadataAsString = mds.GetAs<std::string>(path);
for (const auto & name : unitNames)
for (const auto & name : {"meters", "degrees", "pixels"})
{
auto i = metadataAsString.find(name);
if (i != std::string::npos)
{
metadataAsString.erase(i, name.size());
metadataAsString.erase(i, strlen(name));
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment