Commit 5b0d5d36 authored by Julien Osman's avatar Julien Osman

ENH: Set Radarsat2 IMI with new framwork

parent e9652e77
Pipeline #7233 canceled with stages
in 13 minutes and 12 seconds
This diff is collapsed.
......@@ -296,10 +296,43 @@ void Radarsat2ImageMetadataInterface::ParseGdal(const MetadataSupplierInterface
void Radarsat2ImageMetadataInterface::ParseGeom(const MetadataSupplierInterface & mds)
{
SARParam sarParam;
Fetch(MDStr::Polarization, mds, "POLARIMETRIC_INTERP", 0);
m_Imd.Bands[0].Add(MDGeom::SAR, sarParam);
throw "Not implemented";
// Metadata read by GDAL
Fetch(MDTime::AcquisitionStartTime, mds, "support_data.image_date");
Fetch(MDNum::LineSpacing, mds, "meters_per_pixel_y");
Fetch(MDNum::PixelSpacing, mds, "meters_per_pixel_x");
Fetch(MDNum::PixelSpacing, mds, "meters_per_pixel_x");
Fetch(MDStr::Instrument, mds, "sensor");
m_Imd.Add(MDStr::SensorID, "SAR");
// Product file
std::string ProductFilePath = mds.GetAs<std::string>("", "product_xml_filename");
if (!ProductFilePath.empty())
{
XMLMetadataSupplier ProductMS(ProductFilePath);
m_Imd.Add(MDStr::Mission, ProductMS.GetAs<std::string>("product.sourceAttributes.satellite"));
m_Imd.Add(MDNum::NumberOfLines, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfLines"));
m_Imd.Add(MDNum::NumberOfColumns, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfSamplesPerLine"));
m_Imd.Add(MDTime::ProductionDate,
ProductMS.GetFirstAs<MetaData::Time>("product.imageGenerationParameters.generalProcessingInformation.processingTime"));
m_Imd.Add(MDNum::AverageSceneHeight, ProductMS.GetAs<double>("product.imageAttributes.geographicInformation.referenceEllipsoidParameters.geodeticTerrainHeight"));
m_Imd.Add(MDNum::RadarFrequency, this->GetRadarFrequency());
m_Imd.Add(MDNum::PRF, this->GetPRF());
m_Imd.Add(MDNum::RSF, this->GetRSF());
m_Imd.Add(MDNum::CenterIncidenceAngle, this->GetCenterIncidenceAngle());
m_Imd.Add(MDStr::BeamMode, ProductMS.GetAs<std::string>("product.sourceAttributes.beamModeMnemonic"));
m_Imd.Add("FACILITY_IDENTIFIER", ProductMS.GetAs<std::string>("product.sourceAttributes.inputDatasetFacilityId"));
m_Imd.Add(MDStr::OrbitDirection, ProductMS.GetAs<std::string>("product.sourceAttributes.orbitAndAttitude.orbitInformation.passDirection"));
m_Imd.Add(MDStr::ProductType, ProductMS.GetAs<std::string>("product.imageGenerationParameters.generalProcessingInformation.productType"));
auto polarizations = ProductMS.GetAsVector<std::string>("product.sourceAttributes.radarParameters.polarizations");
assert(polarizations.size() == m_Imd.Bands.size());
SARParam sarParam;
for (int bandId = 0 ; bandId < polarizations.size() ; ++bandId)
{
m_Imd.Bands[bandId].Add(MDStr::Polarization, polarizations[bandId]);
m_Imd.Bands[bandId].Add(MDGeom::SAR, sarParam);
}
}
}
void Radarsat2ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
......
......@@ -1298,10 +1298,10 @@ void TerraSarImageMetadataInterface::ParseGeom(const MetadataSupplierInterface &
void TerraSarImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
// Try to fetch the metadata from GDAL Metadata Supplier
if (mds.GetAs<std::string>("", "SATELLITE_IDENTIFIER") == "RADARSAT-2")
if (mds.GetAs<std::string>("", "DRIVER") == "TSX/TerraSAR-X Product")
this->ParseGdal(mds);
// Try to fetch the metadata from GEOM file
else if (mds.GetAs<std::string>("", "sensor") == "RADARSAT-2")
else if (mds.GetAs<std::string>("", "sensor") == "TSX-1")
this->ParseGeom(mds);
// Failed to fetch the metadata
else
......
......@@ -462,6 +462,7 @@ set(spot6_geom_file ${INPUTDATA}/spot6/spot6-2.geom)
set(ikonos_geom_file ${INPUTDATA}/ikonos/ikonos-2.geom)
set(worldview2_geom_file ${INPUTDATA}/wv2/wv2-2.geom)
set(quickbird_geom_file ${INPUTDATA}/QB/qb-2.geom)
set(Radarsat2_geom_file ${INPUTDATA}/radarsat2/radarsat2-1.geom)
set(CosmoSkyMed_geom_file ${INPUTDATA}/cosmoskymed/cosmoskymed-1.geom)
set(Sentinel1_geom_file ${INPUTDATA}/sentinel1/sentinel1-2.geom)
......
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