Commit 1ab4f1ef authored by Cédric Traizet's avatar Cédric Traizet

ENH: add parsing for spot 6/7 metadata from geom

parent df9fb212
......@@ -60,7 +60,7 @@ public:
* If band >= 0, the metadata value is looked in the specified band*/
virtual std::string GetMetadataValue(std::string const& path, bool& hasValue, int band=-1) const = 0;
bool HasValue(std::string const& path, int band=-1);
bool HasValue(std::string const& path, int band=-1) const;
virtual int GetNbBands() const = 0;
......
......@@ -1697,10 +1697,36 @@ void Spot6ImageMetadataInterface::FetchSpectralSensitivity(const std::string & s
void Spot6ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
DimapMetadataHelper helper;
helper.ParseDimapV2(mds);
// DimapV2 case
if (mds.GetAs<std::string>("", "IMAGERY/SATELLITEID") == "SPOT 6"
|| mds.GetAs<std::string>("", "IMAGERY/SATELLITEID") == "SPOT 7")
{
helper.ParseDimapV2(mds);
m_Imd.Add(MDStr::GeometricLevel, helper.GetDimapData().ProcessingLevel);
// fill RPC model
if (m_Imd[MDStr::GeometricLevel] == "SENSOR")
{
FetchRPC(mds);
}
}
// Geom case
else if (mds.GetAs<std::string>("", "support_data.sensorID") == "SPOT 6"
|| mds.GetAs<std::string>("", "support_data.sensorID") == "SPOT 7")
{
helper.ParseGeom(mds);
m_Imd.Add(MDStr::GeometricLevel, helper.GetDimapData().ProcessingLevel);
}
else
{
otbGenericExceptionMacro(MissingMetadataException,<<"Not a Spot 6/7 product")
}
const auto & dimapData = helper.GetDimapData();
if (dimapData.mission == "SPOT")
{
m_Imd.Add(MDStr::SensorID, dimapData.mission + " " +dimapData.missionIndex);
......@@ -1754,12 +1780,6 @@ void Spot6ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
m_Imd.Add(MDStr::GeometricLevel, dimapData.ProcessingLevel);
// fill RPC model
if (m_Imd[MDStr::GeometricLevel] == "SENSOR")
{
FetchRPC(mds);
}
FetchSpectralSensitivity(m_Imd[MDStr::SensorID]);
}
......
......@@ -458,6 +458,7 @@ set(Sentinel1_filename LARGEINPUT{SENTINEL1/S1A_S6_SLC__1SSV_20150619T195043})
set(spot5_2_geom_file ${INPUTDATA}/spot5/spot5-1.geom)
set(formosat_geom_file ${INPUTDATA}/FORMOSAT_ROI_1000_100.geom)
set(pleiades_geom_file ${INPUTDATA}/pleiades/maido.geom)
set(spot6_geom_file ${INPUTDATA}/spot6/spot6-1.geom)
foreach(sensor ${sensor_list})
......
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