Commit 58910d75 authored by Cédric Traizet's avatar Cédric Traizet

REFAC: pass mds by const reference instead of pointer

parent d59b9ecf
......@@ -90,10 +90,10 @@ public:
double GetCenterIncidenceAngle() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
std::vector<std::map<std::string, std::string> > saveMetadataBands(std::string file) ;
std::vector<Orbit> getOrbits(const MetadataSupplierInterface *, std::string referenceTime) ;
std::vector<Orbit> getOrbits(const MetadataSupplierInterface &, const std::string & referenceTime);
protected:
/* class ctor */
......
......@@ -152,7 +152,7 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
FormosatImageMetadataInterface() = default;
......
......@@ -136,7 +136,7 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
IkonosImageMetadataInterface() = default;
......
......@@ -230,7 +230,7 @@ public:
virtual bool CanRead() const {return false;}
virtual void Parse(const MetadataSupplierInterface *)
virtual void Parse(const MetadataSupplierInterface &)
{
otbGenericExceptionMacro(MissingMetadataException,<<"Metadata parsing not implemented")
}
......@@ -254,9 +254,7 @@ public:
protected:
ImageMetadataInterfaceBase();
~ImageMetadataInterfaceBase() override
{
}
~ImageMetadataInterfaceBase() override = default;
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
......
......@@ -62,7 +62,7 @@ public:
// GDALImageIO and initialize the correct number of bands. It should not be
// needed once we have a merge() function,
/** Create the appropriate IMI based on a MetadataSupplier */
static ImageMetadataInterfaceBasePointerType CreateIMI(const ImageMetadata & imd, const MetadataSupplierInterface *mds);
static ImageMetadataInterfaceBasePointerType CreateIMI(const ImageMetadata & imd, const MetadataSupplierInterface & mds);
/** Register Built-in factories */
static void RegisterBuiltInFactories();
......
......@@ -150,7 +150,7 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
PleiadesImageMetadataInterface();
......
......@@ -136,7 +136,7 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
QuickBirdImageMetadataInterface();
......
......@@ -98,7 +98,7 @@ public:
/*get lookup data for calculating backscatter */
void CreateCalibrationLookupData(const short type) override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
......@@ -106,9 +106,7 @@ protected:
Radarsat2ImageMetadataInterface();
/* class desctructor */
~Radarsat2ImageMetadataInterface() override
{
}
~Radarsat2ImageMetadataInterface() override =default;
private:
Radarsat2ImageMetadataInterface(const Self&) = delete;
......
......@@ -99,16 +99,14 @@ public:
/*get lookup data for calculating backscatter */
void CreateCalibrationLookupData(const short type) override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
/* class ctor */
Sentinel1ImageMetadataInterface();
/* class dtor */
~Sentinel1ImageMetadataInterface() override
{
}
~Sentinel1ImageMetadataInterface() override = default;
/* Fetch the AzimuthFmRate metadata */
std::vector<AzimuthFmRate> GetAzimuthFmRate(const XMLMetadataSupplier&) const;
......@@ -177,9 +175,7 @@ public:
{
}
~Sentinel1CalibrationLookupData() override
{
}
~Sentinel1CalibrationLookupData() override = default;
void InitParameters(short type, double ft, double lt, int lines, int c, std::vector<Sentinel1CalibrationStruct> const& vlist)
{
......
......@@ -150,7 +150,7 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
......
......@@ -158,7 +158,7 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *mds);
void Parse(const MetadataSupplierInterface & mds);
protected:
SpotImageMetadataInterface() = default;
......
......@@ -174,13 +174,11 @@ public:
* in the order R, G, B */
std::vector<unsigned int> GetDefaultDisplay() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
TerraSarImageMetadataInterface();
~TerraSarImageMetadataInterface() override
{
}
~TerraSarImageMetadataInterface() override = default;
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
/** Evaluate polynom with Horner scheme*/
......
......@@ -138,7 +138,7 @@ public:
*/
std::vector<std::string> GetEnhancedBandNames() const override;
void Parse(const MetadataSupplierInterface *) override;
void Parse(const MetadataSupplierInterface &) override;
protected:
WorldView2ImageMetadataInterface() = default;
......
......@@ -301,16 +301,16 @@ std::vector<std::map<std::string, std::string> > CosmoImageMetadataInterface::sa
std::vector<Orbit> CosmoImageMetadataInterface::getOrbits(const MetadataSupplierInterface *mds, std::string reference_UTC)
std::vector<Orbit> CosmoImageMetadataInterface::getOrbits(const MetadataSupplierInterface & mds, const std::string & reference_UTC)
{
////////////////// Add Orbit List ////////////////
bool hasOrbit ;
std::string nb_orbits = mds->GetMetadataValue("Number_of_State_Vectors", hasOrbit) ;
std::string nb_orbits = mds.GetMetadataValue("Number_of_State_Vectors", hasOrbit) ;
// Get elements
int stateVectorList_size = std::stoi(nb_orbits);
std::string state_times = mds->GetMetadataValue("State_Vectors_Times", hasOrbit);
std::string ecef_satellite_pos = mds->GetMetadataValue("ECEF_Satellite_Position", hasOrbit) ;
std::string ecef_satellite_vel = mds->GetMetadataValue("ECEF_Satellite_Velocity", hasOrbit);
std::string state_times = mds.GetMetadataValue("State_Vectors_Times", hasOrbit);
std::string ecef_satellite_pos = mds.GetMetadataValue("ECEF_Satellite_Position", hasOrbit) ;
std::string ecef_satellite_vel = mds.GetMetadataValue("ECEF_Satellite_Velocity", hasOrbit);
// Convert std::string to vector
std::vector<std::string> vTimes;
otb::Utils::ConvertStringToVector(state_times, vTimes, "State_Vectors_Times", " ");
......@@ -355,16 +355,12 @@ std::vector<Orbit> CosmoImageMetadataInterface::getOrbits(const MetadataSupplier
void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
assert(mds->GetNbBands() == this->m_Imd.Bands.size());
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Check SubDatasets (For COSMO, we need //S01/SBI dataset)
auto subDsName = "HDF5:" + mds->GetResourceFile() + "://S01/SBI";
auto subDsName = "HDF5:" + mds.GetResourceFile() + "://S01/SBI";
auto ds = (GDALDataset *) GDALOpen(subDsName.c_str(), GA_ReadOnly );
if (ds)
......@@ -381,9 +377,9 @@ void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
// Metadata read by GDAL
Fetch(MDStr::Mission, *mds, "MISSION_ID");
Fetch(MDStr::Mode, *mds, "Acquisition_Mode");
Fetch(MDStr::ProductType, *mds, "Product_Type");
Fetch(MDStr::Mission, mds, "MISSION_ID");
Fetch(MDStr::Mode, mds, "Acquisition_Mode");
Fetch(MDStr::ProductType, mds, "Product_Type");
// Check Mission Id, acquisition mode and product type
if(! (m_Imd[MDStr::Mission] == "CSK" ))
......@@ -403,30 +399,30 @@ void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
}
m_Imd.Add(MDStr::SensorID, "CSK");
Fetch(MDStr::Instrument, *mds, "Satellite_ID");
Fetch(MDStr::Instrument, mds, "Satellite_ID");
Fetch(MDStr::OrbitDirection, *mds, "Orbit_Direction");
Fetch(MDStr::OrbitDirection, mds, "Orbit_Direction");
bool hasOrbitNumber ;
std::string orbitNumber = mds->GetMetadataValue("Orbit_Number", hasOrbitNumber) ;
std::string orbitNumber = mds.GetMetadataValue("Orbit_Number", hasOrbitNumber) ;
m_Imd.Add(MDNum::OrbitNumber, std::stoi(orbitNumber));
bool hasRadarFrequency ;
std::string radarFrequency = mds->GetMetadataValue("Radar_Frequency", hasRadarFrequency) ;
std::string radarFrequency = mds.GetMetadataValue("Radar_Frequency", hasRadarFrequency) ;
m_Imd.Add(MDNum::RadarFrequency, std::stod(radarFrequency));
Fetch(MDStr::Polarization, *mds, "S01_Polarisation") ;
Fetch(MDStr::Polarization, mds, "S01_Polarisation") ;
m_Imd.Add(MDStr::Swath, "S1");
bool hasPRF;
std::string PRFNumber = mds->GetMetadataValue("S01_PRF", hasPRF);
std::string PRFNumber = mds.GetMetadataValue("S01_PRF", hasPRF);
m_Imd.Add(MDNum::PRF, std::stoi(PRFNumber));
//getTIme
auto metadataBands = this->saveMetadataBands(subDsName) ;
bool hasTimeUTC;
int pos = mds->GetMetadataValue("Reference_UTC", hasTimeUTC).find(" ");;
std::string reference_UTC = mds->GetMetadataValue("Reference_UTC", hasTimeUTC).substr(0, pos);
int pos = mds.GetMetadataValue("Reference_UTC", hasTimeUTC).find(" ");;
std::string reference_UTC = mds.GetMetadataValue("Reference_UTC", hasTimeUTC).substr(0, pos);
double total_seconds = std::stod(metadataBands[0]["S01_SBI_Zero_Doppler_Azimuth_First_Time"]);
int hour = static_cast<int> (total_seconds/3600.0);
......
......@@ -1371,11 +1371,11 @@ void FormosatImageMetadataInterface::FetchSpectralSensitivity()
}
void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
Fetch(MDStr::SensorID, *mds, "IMAGERY/SATELLITEID");
Fetch(MDStr::SensorID, mds, "IMAGERY/SATELLITEID");
if (m_Imd[MDStr::SensorID] == "FORMOSAT 2")
{
m_Imd.Add(MDStr::Mission, "Formasat 2");
......@@ -1386,7 +1386,7 @@ void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
}
//Find the METADATA.DIM file (Dimap V1 metadata file)
auto resourceFiles = mds->GetResourceFiles();
auto resourceFiles = mds.GetResourceFiles();
std::string metadataFile;
for (const auto & file: resourceFiles)
......@@ -1488,7 +1488,7 @@ void FormosatImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
// fill RPC model
if (m_Imd[MDStr::GeometricLevel] == "SENSOR")
{
FetchRPC(*mds);
FetchRPC(mds);
}
}
......
......@@ -1184,20 +1184,18 @@ void IkonosImageMetadataInterface::FetchSpectralSensitivity(const std::string &
}
void IkonosImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void IkonosImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
bool hasValue = 0;
auto metadatatype = mds->GetMetadataValue("METADATATYPE", hasValue);
auto metadatatype = mds.GetMetadataValue("METADATATYPE", hasValue);
if (!hasValue || metadatatype != "GE")
{
otbGenericExceptionMacro(MissingMetadataException,
<< "No Geo-Eye metadata has been found")
}
auto inputFilenameWithDir = mds->GetResourceFile();
auto inputFilenameWithDir = mds.GetResourceFile();
auto inputFilename = itksys::SystemTools::GetFilenameName(inputFilenameWithDir);
// Find hdr and metadata files :
......@@ -1288,7 +1286,7 @@ void IkonosImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
m_Imd.Bands[0].Add(MDNum::PhysicalBias, 0.);
m_Imd.Bands[0].Add(MDNum::SolarIrradiance, ikonosSolarIrradiance[bandName]);
FetchRPC(*mds);
FetchRPC(mds);
FetchSpectralSensitivity(bandName);
}
......
......@@ -89,7 +89,7 @@ ImageMetadataInterfaceFactory::ImageMetadataInterfaceBasePointerType ImageMetada
ImageMetadataInterfaceFactory::ImageMetadataInterfaceBasePointerType
ImageMetadataInterfaceFactory
::CreateIMI(const ImageMetadata & imd, const MetadataSupplierInterface *mds)
::CreateIMI(const ImageMetadata & imd, const MetadataSupplierInterface & mds)
{
RegisterBuiltInFactories();
......
......@@ -2213,17 +2213,15 @@ void PleiadesImageMetadataInterface::FetchSpectralSensitivity(const std::string
}
}
void PleiadesImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void PleiadesImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
bool hasValue = false;
auto metadatatype = mds->GetMetadataValue("METADATATYPE", hasValue);
auto dimapV1Filename = itksys::SystemTools::GetParentDirectory(mds->GetResourceFile()) + "/PHRDIMAP.XML";
auto metadatatype = mds.GetMetadataValue("METADATATYPE", hasValue);
auto dimapV1Filename = itksys::SystemTools::GetParentDirectory(mds.GetResourceFile()) + "/PHRDIMAP.XML";
DimapMetadataHelper helper;
helper.Parse(*mds);
helper.Parse(mds);
const auto & dimapData = helper.GetDimapData();
if (dimapData.mission == "PHR")
......@@ -2288,7 +2286,7 @@ void PleiadesImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
// fill RPC model
if (m_Imd[MDStr::GeometricLevel] == "SENSOR")
{
FetchRPC(*mds);
FetchRPC(mds);
}
}
......
......@@ -1372,12 +1372,11 @@ namespace
}
}
void QuickBirdImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void QuickBirdImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
// Check if there is DG metadatas
bool hasValue = false;
auto metadatatype = mds->GetMetadataValue("METADATATYPE", hasValue);
auto metadatatype = mds.GetMetadataValue("METADATATYPE", hasValue);
if (!hasValue || metadatatype != "DG")
{
otbGenericExceptionMacro(MissingMetadataException,
......@@ -1385,7 +1384,7 @@ void QuickBirdImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
}
// Check if the sensor is WorldView 2
auto sensorID = mds->GetMetadataValue("IMD/IMAGE_1.satId", hasValue);
auto sensorID = mds.GetMetadataValue("IMD/IMAGE_1.satId", hasValue);
if (sensorID.find("QB02") != std::string::npos)
{
......@@ -1397,7 +1396,7 @@ void QuickBirdImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
otbGenericExceptionMacro(MissingMetadataException, << "Not a Quickbird image")
}
auto ressourceFiles = mds->GetResourceFiles();
auto ressourceFiles = mds.GetResourceFiles();
// return true if the file extension is .IMD
auto lambda = [](const std::string & filename){return itksys::SystemTools::GetFilenameLastExtension(filename) == ".IMD";};
......@@ -1446,31 +1445,31 @@ void QuickBirdImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
file.close();
}
auto geometricLevel = mds->GetMetadataValue("IMD/productLevel", hasValue);
auto geometricLevel = mds.GetMetadataValue("IMD/productLevel", hasValue);
// throw missing
Unquote(geometricLevel);
m_Imd.Add(MDStr::GeometricLevel, geometricLevel);
auto productType = mds->GetMetadataValue("IMD/bandId", hasValue);
auto productType = mds.GetMetadataValue("IMD/bandId", hasValue);
// throw missing
Unquote(productType);
m_Imd.Add(MDStr::ProductType, productType);
// Acquisition and production dates
FetchDates(*mds);
FetchDates(mds);
//Radiometry
Fetch(MDNum::SunElevation, *mds, "IMD/IMAGE_1.sunEl");
Fetch(MDNum::SunAzimuth, *mds, "IMD/IMAGE_1.sunAz");
Fetch(MDNum::SatElevation, *mds, "IMD/IMAGE_1.satAz");
Fetch(MDNum::SatAzimuth , *mds, "IMD/IMAGE_1.satEl");
Fetch(MDNum::SunElevation, mds, "IMD/IMAGE_1.sunEl");
Fetch(MDNum::SunAzimuth, mds, "IMD/IMAGE_1.sunAz");
Fetch(MDNum::SatElevation, mds, "IMD/IMAGE_1.satAz");
Fetch(MDNum::SatAzimuth , mds, "IMD/IMAGE_1.satEl");
FetchPhysicalBias();
FetchSolarIrradiance();
FetchPhysicalGain(*mds);
FetchPhysicalGain(mds);
FetchSpectralSensitivity();
FetchRPC(*mds);
FetchRPC(mds);
}
} // end namespace otb
......@@ -243,32 +243,30 @@ Radarsat2ImageMetadataInterface::UIntVectorType Radarsat2ImageMetadataInterface:
//"
void Radarsat2ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void Radarsat2ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
assert(mds->GetNbBands() == this->m_Imd.Bands.size());
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Metadata read by GDAL
Fetch(MDTime::AcquisitionStartTime, *mds, "ACQUISITION_START_TIME");
// Fetch(MDTime::AcquisitionStopTime, *mds, "PROCESSING_TIME");
Fetch(MDStr::BeamMode, *mds, "BEAM_MODE");
Fetch("FACILITY_IDENTIFIER", *mds, "FACILITY_IDENTIFIER");
Fetch(MDNum::LineSpacing, *mds, "LINE_SPACING");
Fetch(MDNum::PixelSpacing, *mds, "PIXEL_SPACING");
// Fetch(MDStr::Mode, *mds, "MODE");
Fetch(MDStr::OrbitDirection, *mds, "ORBIT_DIRECTION");
// Fetch(MDNum::OrbitNumber, *mds, "ORBIT_NUMBER");
Fetch(MDNum::PixelSpacing, *mds, "PIXEL_SPACING");
Fetch(MDStr::ProductType, *mds, "PRODUCT_TYPE");
Fetch(MDStr::Instrument, *mds, "SATELLITE_IDENTIFIER");
Fetch(MDStr::SensorID, *mds, "SENSOR_IDENTIFIER");
Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
// Fetch(MDTime::AcquisitionStopTime, mds, "PROCESSING_TIME");
Fetch(MDStr::BeamMode, mds, "BEAM_MODE");
Fetch("FACILITY_IDENTIFIER", mds, "FACILITY_IDENTIFIER");
Fetch(MDNum::LineSpacing, mds, "LINE_SPACING");
Fetch(MDNum::PixelSpacing, mds, "PIXEL_SPACING");
// Fetch(MDStr::Mode, mds, "MODE");
Fetch(MDStr::OrbitDirection, mds, "ORBIT_DIRECTION");
// Fetch(MDNum::OrbitNumber, mds, "ORBIT_NUMBER");
Fetch(MDNum::PixelSpacing, mds, "PIXEL_SPACING");
Fetch(MDStr::ProductType, mds, "PRODUCT_TYPE");
Fetch(MDStr::Instrument, mds, "SATELLITE_IDENTIFIER");
Fetch(MDStr::SensorID, mds, "SENSOR_IDENTIFIER");
// Product file
std::string ProductFilePath = mds->GetResourceFile("product.xml");
std::string ProductFilePath = mds.GetResourceFile("product.xml");
if (!ProductFilePath.empty())
{
// std::cout<< ProductFilePath << std::endl;
XMLMetadataSupplier ProductMS(ProductFilePath);
m_Imd.Add(MDStr::Mission, ProductMS.GetAs<std::string>("product.sourceAttributes.satellite"));
......@@ -287,9 +285,9 @@ void Radarsat2ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
SARParam sarParam;
for (int bandId = 0 ; bandId < mds->GetNbBands() ; ++bandId)
for (int bandId = 0 ; bandId < mds.GetNbBands() ; ++bandId)
{
Fetch(MDStr::Polarization, *mds, "POLARIMETRIC_INTERP", bandId);
Fetch(MDStr::Polarization, mds, "POLARIMETRIC_INTERP", bandId);
m_Imd.Bands[bandId].Add(MDGeom::SAR, sarParam);
}
}
......
......@@ -524,29 +524,28 @@ double Sentinel1ImageMetadataInterface::getBandTerrainHeight(const XMLMetadataSu
return heightSum / (double)listCount;
}
void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds);
assert(mds->GetNbBands() == this->m_Imd.Bands.size());
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");
Fetch(MDStr::BeamMode, *mds, "BEAM_MODE");
Fetch(MDStr::BeamSwath, *mds, "BEAM_SWATH");
Fetch("FACILITY_IDENTIFIER", *mds, "FACILITY_IDENTIFIER");
Fetch(MDNum::LineSpacing, *mds, "LINE_SPACING");
Fetch(MDStr::Mission, *mds, "MISSION_ID");
Fetch(MDStr::Mode, *mds, "MODE");
Fetch(MDStr::OrbitDirection, *mds, "ORBIT_DIRECTION");
Fetch(MDNum::OrbitNumber, *mds, "ORBIT_NUMBER");
Fetch(MDNum::PixelSpacing, *mds, "PIXEL_SPACING");
Fetch(MDStr::ProductType, *mds, "PRODUCT_TYPE");
Fetch(MDStr::Instrument, *mds, "SATELLITE_IDENTIFIER");
Fetch(MDStr::SensorID, *mds, "SENSOR_IDENTIFIER");
Fetch(MDStr::Swath, *mds, "SWATH");
Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
Fetch(MDTime::AcquisitionStopTime, mds, "ACQUISITION_STOP_TIME");
Fetch(MDStr::BeamMode, mds, "BEAM_MODE");
Fetch(MDStr::BeamSwath, mds, "BEAM_SWATH");
Fetch("FACILITY_IDENTIFIER", mds, "FACILITY_IDENTIFIER");
Fetch(MDNum::LineSpacing, mds, "LINE_SPACING");
Fetch(MDStr::Mission, mds, "MISSION_ID");
Fetch(MDStr::Mode, mds, "MODE");
Fetch(MDStr::OrbitDirection, mds, "ORBIT_DIRECTION");
Fetch(MDNum::OrbitNumber, mds, "ORBIT_NUMBER");
Fetch(MDNum::PixelSpacing, mds, "PIXEL_SPACING");
Fetch(MDStr::ProductType, mds, "PRODUCT_TYPE");
Fetch(MDStr::Instrument, mds, "SATELLITE_IDENTIFIER");
Fetch(MDStr::SensorID, mds, "SENSOR_IDENTIFIER");
Fetch(MDStr::Swath, mds, "SWATH");
// Manifest file
std::string ManifestFilePath = mds->GetResourceFile(std::string("manifest\\.safe"));
std::string ManifestFilePath = mds.GetResourceFile(std::string("manifest\\.safe"));
if (!ManifestFilePath.empty())
{
XMLMetadataSupplier ManifestMS(ManifestFilePath);
......@@ -557,14 +556,14 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
}
// Band metadata
for (int bandId = 0 ; bandId < mds->GetNbBands() ; ++bandId)
for (int bandId = 0 ; bandId < mds.GetNbBands() ; ++bandId)
{
SARParam sarParam;
Fetch(MDStr::Polarization, *mds, "POLARISATION", bandId);
std::string swath = Fetch(MDStr::Swath, *mds, "SWATH", bandId);
Fetch(MDStr::Polarization, mds, "POLARISATION", bandId);
std::string swath = Fetch(MDStr::Swath, mds, "SWATH", bandId);
// Annotation file
std::string AnnotationFilePath = mds->GetResourceFile(std::string("annotation[/\\\\]s1[ab].*-")
std::string AnnotationFilePath = mds.GetResourceFile(std::string("annotation[/\\\\]s1[ab].*-")
+ itksys::SystemTools::LowerCase(swath)
+ std::string("-.*\\.xml"));
if (AnnotationFilePath.empty())
......
......@@ -1694,12 +1694,11 @@ void Spot6ImageMetadataInterface::FetchSpectralSensitivity(const std::string & s
}
}
void Spot6ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
void Spot6ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{