Commit a6c88a59 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

WIP: add RPC parsing for SPOT 6

parent 0a4fe5bf
Pipeline #5740 failed with stages
in 5 minutes and 28 seconds
......@@ -150,6 +150,9 @@ public:
* There values a computed by 6S. */
WavelengthSpectralBandVectorType GetSpectralSensitivity() const override;
void Parse(const MetadataSupplierInterface *) override;
protected:
Spot6ImageMetadataInterface();
~Spot6ImageMetadataInterface() override
......
......@@ -955,7 +955,30 @@ QuickBirdImageMetadataInterface::WavelengthSpectralBandVectorType QuickBirdImage
}
void QuickBirdImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
{
{
assert(mds);
// Check if there is DG metadatas
bool hasValue = false;
auto metadatatype = mds->GetMetadataValue("METADATATYPE", hasValue);
if (!hasValue || metadatatype != "DG")
{
otbGenericExceptionMacro(MissingMetadataException,
<< "No Digital Globe metadata has been found")
}
// Check if the sensor is WorldView 2
auto sensorID = mds->GetMetadataValue("IMD/IMAGE_1.satId", hasValue);
if (sensorID.find("QB02") != std::string::npos)
{
m_Imd.Add(MDStr::SensorID, "QB02");
m_Imd.Add(MDStr::Mission, "Quickbird");
}
else
{
otbGenericExceptionMacro(MissingMetadataException, << "Not a Quickbird image")
}
FetchRPC(*mds);
}
......
......@@ -26,6 +26,8 @@
#include "otbImageKeywordlist.h"
#include "otbStringUtils.h"
#include "otbDimapMetadataHelper.h"
namespace otb
{
using boost::lexical_cast;
......@@ -1252,4 +1254,36 @@ Spot6ImageMetadataInterface::WavelengthSpectralBandVectorType Spot6ImageMetadata
return wavelengthSpectralBand;
}
void Spot6ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds)
{
assert(mds);
std::cout << "Spot6ImageMetadataInterface::Parse" << std::endl;
/*
bool hasValue = false;
auto metadatatype = mds->GetMetadataValue("METADATATYPE", hasValue);
// DIMAP metadata has already been parsed by gdal
if (hasValue && metadatatype == "DIMAP")
{
DimapMetadataHelper helper(mds);
helper.ParseRadiometry(m_Imd);
}
*/
Fetch(MDStr::SensorID, *mds, "IMAGERY/SATELLITEID");
if (strncmp(m_Imd[MDStr::SensorID].c_str(), "SPOT 6", 6) == 0)
{
m_Imd.Add(MDStr::Mission, "SPOT 6");
}
else
{
otbGenericExceptionMacro(MissingMetadataException,<<"Not a spot 6 product")
}
FetchRPC(*mds);
}
} // end namespace otb
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