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

Merge branch '2159' into 2160-SarSensorModel-burst

parents 6b0bbc23 9a2f068a
Pipeline #7875 passed with stages
in 124 minutes and 19 seconds
......@@ -21,7 +21,7 @@ opencv_ml_rtrees:
cat_ofs: [ 0, 0, 0, 0, 0, 0, 0, 0 ]
class_labels: [ 1, 2, 3, 4 ]
missing_subst: [ 0., 0., 0., 0., 0. ]
oob_error: 4.6082949308755760e-03
oob_error: 7.0093457943925233e-03
ntrees: 1
trees:
-
......@@ -31,96 +31,54 @@ opencv_ml_rtrees:
value: 3.
norm_class_idx: 2
splits:
- { var:2, quality:7.5442163085937500e+02,
le:1.5328201293945312e+02 }
- { var:3, quality:9.0135681152343750e+02,
le:1.6233364868164062e+02 }
-
depth: 1
value: 1.
norm_class_idx: 0
splits:
- { var:1, quality:4.9118682861328125e+02,
le:2.7847836303710938e+02 }
-
depth: 2
depth: 1
value: 3.
norm_class_idx: 2
splits:
- { var:3, quality:54., le:1.7026905822753906e+02 }
-
depth: 3
value: 1.
norm_class_idx: 0
- { var:0, quality:6.0693487548828125e+02,
le:2.3812664794921875e+02 }
-
depth: 3
depth: 2
value: 3.
norm_class_idx: 2
-
depth: 2
value: 1.
norm_class_idx: 0
splits:
- { var:0, quality:5.1905541992187500e+02,
le:2.1241384887695312e+02 }
- { var:1, quality:5.1901708984375000e+02,
le:3.1056585693359375e+02 }
-
depth: 3
value: 3.
norm_class_idx: 2
splits:
- { var:2, quality:39., le:1.3915295410156250e+02 }
-
depth: 4
value: 1.
norm_class_idx: 0
-
depth: 4
depth: 3
value: 3.
norm_class_idx: 2
-
depth: 3
value: 1.
norm_class_idx: 0
splits:
- { var:0, quality:4.8239999389648438e+02,
le:2.1394296264648438e+02 }
- { var:3, quality:117., le:2.9698010253906250e+02 }
-
depth: 4
value: 1.
norm_class_idx: 0
value: 2.
norm_class_idx: 1
-
depth: 4
value: 1.
norm_class_idx: 0
-
depth: 1
value: 3.
norm_class_idx: 2
splits:
- { var:3, quality:4.5026675415039062e+02,
le:3.0965036010742188e+02 }
-
depth: 2
value: 2.
norm_class_idx: 1
splits:
- { var:2, quality:97., le:1.6953280639648438e+02 }
-
depth: 3
value: 1.
norm_class_idx: 0
- { var:3, quality:174., le:3.3038479614257812e+02 }
-
depth: 3
value: 2.
norm_class_idx: 1
-
depth: 2
value: 3.
norm_class_idx: 2
splits:
- { var:1, quality:511., le:3.5593637084960938e+02 }
-
depth: 3
value: 3.
norm_class_idx: 2
-
depth: 3
value: 4.
......
......@@ -2,14 +2,16 @@ SensorID SAR
Mission RADARSAT-2
Instrument RADARSAT-2
ProductType SLC
Polarization HH
OrbitDirection Descending
BeamMode FQ9
TileHintX 2822
TileHintY 185
DataType 11
DataType 4
NumberOfLines 12953
NumberOfColumns 2822
AverageSceneHeight 453.201
CalScale 1
PRF 0
RSF 0
RadarFrequency 0
......@@ -18,17 +20,10 @@ LineSpacing 4.8254
PixelSpacing 4.73308
ProductionDate 2008-04-05T13:35:50Z
AcquisitionStartTime 2008-04-05T12:49:00.995676Z
SAR <SARParam>
SARCalib <SARCalib>
GCP <GCPParam>
Extra.FACILITY_IDENTIFIER GATN
Polarization HH
SAR <SARParam>
Polarization VV
SAR <SARParam>
Polarization HV
SAR <SARParam>
Polarization VH
SAR <SARParam>
{"Projection": "GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]",
[{"GCP_Id": "1", "GCP_Info": "", "GCP_Row": "0.5", "GCP_Col": "0.5", "GCP_X": "-97.5857", "GCP_Y": "49.4039", "GCP_Z": "453.201", },
{"GCP_Id": "2", "GCP_Info": "", "GCP_Row": "0.5", "GCP_Col": "217.5", "GCP_X": "-97.5577", "GCP_Y": "49.4002", "GCP_Z": "453.201", },
......
PROJCS["WGS_1984_UTM_Zone_31N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
\ No newline at end of file
......@@ -13,6 +13,7 @@
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.0/">7.0.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.1/">7.1.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.2/">7.2.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.3/">7.3.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-8.0/">8.0.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-develop/">develop</a></dd>
</dl>
......
......@@ -63,7 +63,7 @@ process:
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `MuParserX <http://muparserx.beltoforion.de>`_ | No | 4.0.7 | 4.0.7 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `OpenCV <http://opencv.org>`_ | No | 3.0.0 | 4.1.1 |
| `OpenCV <http://opencv.org>`_ | No | 3.0.0 | 4.5.1 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `OPENGL <https://www.opengl.org/>`_ | No | | |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
......
/*
* Copyright (C) 2005-2019 by Centre National d'Etudes Spatiales (CNES)
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
*
* This file is licensed under MIT license:
* This file is part of Orfeo Toolbox
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* https://www.orfeo-toolbox.org/
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
......
......@@ -22,6 +22,7 @@
#define otbGeomMetadataSupplier_h
#include <boost/any.hpp>
#include <unordered_map>
#include "OTBMetadataExport.h"
#include "otbMetadataSupplierInterface.h"
......@@ -43,7 +44,8 @@ class OTBMetadata_EXPORT GeomMetadataSupplier
public:
using DictType = std::unordered_map<std::string, std::string>;
GeomMetadataSupplier(const std::string &);
GeomMetadataSupplier(const std::string & geomFile);
GeomMetadataSupplier(const std::string & geomFile, const std::string & imageFile);
GeomMetadataSupplier(const GeomMetadataSupplier &) = delete;
GeomMetadataSupplier& operator=(const GeomMetadataSupplier&) = delete;
~GeomMetadataSupplier() = default;
......@@ -59,6 +61,7 @@ public:
std::string GetMetadataValue(std::string const& path, bool& hasValue, int band=1) const override;
std::string GetResourceFile(std::string const& s="") const override;
std::vector<std::string> GetResourceFiles() const override;
int GetNbBands() const override;
......@@ -96,9 +99,10 @@ protected:
private:
/** List of resource files */
std::string m_FileName;
std::unordered_map<std::string, std::string> m_FileNames;
/** Dictionary containing the metadata */
DictType m_MetadataDic;
};
} // end namespace otb
......
......@@ -81,6 +81,8 @@ public:
/** If multiple keys have the same path, gives the position of the one with value value*/
virtual unsigned int GetAttributId(std::string const& path, std::string const& value) const = 0;
virtual ~MetadataSupplierInterface() = default;
};
template <> bool MetadataSupplierInterface::GetAs(bool const& defaultValue, std::string const& path, int band) const;
......
......@@ -115,6 +115,7 @@ public:
*/
std::string PrintSelf() const;
~XMLMetadataSupplier() = default;
protected:
/**
* @brief ReadXMLToList Transform xml to list of NULL terminated name=value
......
......@@ -372,19 +372,22 @@ std::vector<BurstRecord> CosmoImageMetadataInterface::CreateBurstRecord(const st
return {record};
}
bool not_in(std::vector<std::string> possible_values, std::string test_value)
{
return std::none_of(possible_values.begin(), possible_values.end(), [test_value](std::string s){return s == test_value;});
}
void CosmoImageMetadataInterface::ParseGdal(ImageMetadata & imd)
{
// Check acquisition mode and product type
Fetch(MDStr::Mode, imd, "Acquisition_Mode");
if((imd[MDStr::Mode] != "HIMAGE") &&
(imd[MDStr::Mode] != "SPOTLIGHT") &&
(imd[MDStr::Mode] != "ENHANCED SPOTLIGHT"))
if (not_in({"HIMAGE", "SPOTLIGHT", "ENHANCED SPOTLIGHT"}, imd[MDStr::Mode]))
{
otbGenericExceptionMacro(MissingMetadataException, "Not an expected acquisition mode (only HIMAGE and SPOTLIGHT expected)" << imd[MDStr::Mode] );
}
Fetch(MDStr::ProductType, imd, "Product_Type");
if( (imd[MDStr::ProductType] != "SCS_B") && imd[MDStr::ProductType] != "SCS_U")
if (not_in({"SCS_B", "SCS_U"}, imd[MDStr::ProductType]))
{
otbGenericExceptionMacro(MissingMetadataException, "Not an expected product type (only SCS_B and SCS_U expected) " << imd[MDStr::ProductType] );
}
......@@ -475,16 +478,14 @@ void CosmoImageMetadataInterface::ParseGeom(ImageMetadata &imd)
{
// Check acquisition mode and product type
Fetch(MDStr::Mode, imd, "support_data.acquisition_mode");
if((imd[MDStr::Mode] != "HIMAGE") &&
(imd[MDStr::Mode] != "SPOTLIGHT") &&
(imd[MDStr::Mode] != "ENHANCED SPOTLIGHT"))
if(not_in({"HIMAGE", "SPOTLIGHT", "ENHANCED SPOTLIGHT"}, imd[MDStr::Mode]))
{
otbGenericExceptionMacro(MissingMetadataException, << "Not an expected acquisition mode (only HIMAGE and SPOTLIGHT expected)" << imd[MDStr::Mode] );
}
Fetch(MDStr::ProductType, imd, "support_data.product_type");
if( (imd[MDStr::ProductType] != "SCS_B") && imd[MDStr::ProductType] != "SCS_U")
if(not_in({"SCS_B", "SCS_U"}, imd[MDStr::ProductType]))
{
otbGenericExceptionMacro(MissingMetadataException, << "Not an expected product type (only SCS_B and SCS_U expected) " << imd[MDStr::ProductType] );
}
......
......@@ -30,9 +30,14 @@
namespace otb
{
GeomMetadataSupplier::GeomMetadataSupplier(std::string const& fileName)
: m_FileName(fileName)
GeomMetadataSupplier::GeomMetadataSupplier(std::string const& geomFile)
: GeomMetadataSupplier(geomFile, "")
{}
GeomMetadataSupplier::GeomMetadataSupplier(std::string const& geomFile, const std::string & imageFile)
{
this->m_FileNames["geom"] = geomFile;
this->m_FileNames["image"] = imageFile;
this->ReadGeomFile();
}
......@@ -48,9 +53,17 @@ std::string GeomMetadataSupplier::GetMetadataValue(std::string const& path, bool
return "";
}
std::string GeomMetadataSupplier::GetResourceFile(std::string const&) const
std::string GeomMetadataSupplier::GetResourceFile(std::string const& name) const
{
assert((name == "") || (name == "geom") || (name == "image"));
if (name.empty())
return this->m_FileNames.at("geom");
return this->m_FileNames.at(name);
}
std::vector<std::string> GeomMetadataSupplier::GetResourceFiles() const
{
return this->m_FileName;
return std::vector<std::string>({this->m_FileNames.at("geom"), this->m_FileNames.at("image")});
}
int GeomMetadataSupplier::GetNbBands() const
......@@ -135,7 +148,7 @@ bool GeomMetadataSupplier::FetchRPC(ImageMetadata & imd)
std::string GeomMetadataSupplier::PrintSelf() const
{
std::ostringstream oss;
oss << "GeomMetadataSupplier: " << this->m_FileName << '\n';
oss << "GeomMetadataSupplier: " << this->m_FileNames.at("geom") << '\t' << this->m_FileNames.at("image") << '\n';
for (const auto& kv : this->m_MetadataDic)
oss << kv.first << " : " << kv.second << '\n';
return oss.str();
......@@ -143,16 +156,16 @@ std::string GeomMetadataSupplier::PrintSelf() const
void GeomMetadataSupplier::ReadGeomFile()
{
std::ifstream inputFile(this->m_FileName);
std::string line;
std::vector< std::string > keyVal;
std::ifstream inputFile(this->m_FileNames.at("geom"));
std::string line, key, value;
std::string::size_type pos;
while (std::getline(inputFile, line))
{
auto pos = line.find(":");
pos = line.find(":");
if (pos != std::string::npos)
{
auto key = line.substr(0,pos);
auto value = line.substr(pos+1, line.size());
key = line.substr(0,pos);
value = line.substr(pos+1, line.size());
boost::trim(key);
boost::trim(value);
m_MetadataDic[key] = value;
......
......@@ -26,11 +26,13 @@
#include "otbMacro.h"
#include "itkMetaDataObject.h"
#include "otbImageKeywordlist.h"
#include "otbSpatialReference.h"
// useful constants
#include <otbMath.h>
#include "otbXMLMetadataSupplier.h"
#include <boost/filesystem.hpp>
#include "itksys/SystemTools.hxx"
namespace otb
{
......@@ -61,53 +63,54 @@ bool Radarsat2ImageMetadataInterface::CreateCalibrationLookupData(SARCalib& sarC
const MetadataSupplierInterface& mds,
const bool geom) const
{
if(SarImageMetadataInterface::CreateCalibrationLookupData(sarCalib, imd, mds, geom))
return true;
int offset = 0;
std::ostringstream ossSigma;
std::ostringstream ossBeta;
std::ostringstream ossGamma;
Radarsat2CalibrationLookupData::Pointer sigmaSarLut = Radarsat2CalibrationLookupData::New();
Radarsat2CalibrationLookupData::Pointer betaSarLut = Radarsat2CalibrationLookupData::New();
Radarsat2CalibrationLookupData::Pointer gammaSarLut = Radarsat2CalibrationLookupData::New();
Radarsat2CalibrationLookupData::Pointer dnSarLut = Radarsat2CalibrationLookupData::New();
if(geom)
{
ossSigma << "referenceNoiseLevel[SigmaNought].gain";
ossBeta << "referenceNoiseLevel[BetaNought].gain";
ossGamma << "referenceNoiseLevel[GammaNought].gain";
std::string path = "referenceNoiseLevel[SigmaNought].gain";
auto glist = mds.GetAsVector<float>(path);
sigmaSarLut->InitParameters(SarCalibrationLookupData::SIGMA, offset, glist);
path = "referenceNoiseLevel[BetaNought].gain";
glist = mds.GetAsVector<float>(path);
betaSarLut->InitParameters(SarCalibrationLookupData::BETA, offset, glist);
path = "referenceNoiseLevel[Gamma].gain";
glist = mds.GetAsVector<float>(path);
gammaSarLut->InitParameters(SarCalibrationLookupData::GAMMA, offset, glist);
}
else
{
ossSigma << "product.sourceAttributes.radarParameters.referenceNoiseLevel_"
<< mds.GetAttributId("product.sourceAttributes.radarParameters.referenceNoiseLevel_#.incidenceAngleCorrection",
"Sigma Nought")
<< ".noiseLevelValues";
ossBeta << "product.sourceAttributes.radarParameters.referenceNoiseLevel_"
<< mds.GetAttributId("product.sourceAttributes.radarParameters.referenceNoiseLevel_#.incidenceAngleCorrection",
"Beta Nought")
<< ".noiseLevelValues";
ossGamma << "product.sourceAttributes.radarParameters.referenceNoiseLevel_"
<< mds.GetAttributId("product.sourceAttributes.radarParameters.referenceNoiseLevel_#.incidenceAngleCorrection",
"gamma")
<< ".noiseLevelValues";
std::string pathGains = "lut.gains";
auto productPath = boost::filesystem::path(mds.GetResourceFile()); // TODO C++ 2017 use std::filesystem
productPath = productPath.remove_filename() /= "lutSigma.xml";
XMLMetadataSupplier sigmaLutSupplier(productPath.string());
auto glist = sigmaLutSupplier.GetAsVector<float>(pathGains);
sigmaSarLut->InitParameters(SarCalibrationLookupData::SIGMA, offset, glist);
productPath = productPath.remove_filename() /= "lutBeta.xml";
XMLMetadataSupplier betaLutSupplier(productPath.string());
glist = betaLutSupplier.GetAsVector<float>(pathGains);
betaSarLut->InitParameters(SarCalibrationLookupData::BETA, offset, glist);
productPath = productPath.remove_filename() /= "lutGamma.xml";
XMLMetadataSupplier gammaLutSupplier(productPath.string());
glist = gammaLutSupplier.GetAsVector<float>(pathGains);
gammaSarLut->InitParameters(SarCalibrationLookupData::GAMMA, offset, glist);
}
Radarsat2CalibrationLookupData::Pointer sigmaSarLut = Radarsat2CalibrationLookupData::New();
auto glist = mds.GetAsVector<float>(ossSigma.str());
sigmaSarLut->InitParameters(SarCalibrationLookupData::SIGMA, offset, glist);
sarCalib.calibrationLookupData[SarCalibrationLookupData::SIGMA] = std::move(sigmaSarLut);
Radarsat2CalibrationLookupData::Pointer betaSarLut = Radarsat2CalibrationLookupData::New();
glist = mds.GetAsVector<float>(ossSigma.str());
betaSarLut->InitParameters(SarCalibrationLookupData::BETA, offset, glist);
sarCalib.calibrationLookupData[SarCalibrationLookupData::BETA] = std::move(betaSarLut);
Radarsat2CalibrationLookupData::Pointer gammaSarLut = Radarsat2CalibrationLookupData::New();
glist = mds.GetAsVector<float>(ossSigma.str());
gammaSarLut->InitParameters(SarCalibrationLookupData::GAMMA, offset, glist);
sarCalib.calibrationLookupData[SarCalibrationLookupData::GAMMA] = std::move(gammaSarLut);
Radarsat2CalibrationLookupData::Pointer dnSarLut = Radarsat2CalibrationLookupData::New();
sarCalib.calibrationLookupData[SarCalibrationLookupData::DN] = std::move(dnSarLut);
return true;
......@@ -255,56 +258,96 @@ Radarsat2ImageMetadataInterface::UIntVectorType Radarsat2ImageMetadataInterface:
return rgb;
}
void Radarsat2ImageMetadataInterface::ParseGdal(ImageMetadata & imd)
void ReadGeorefGCP(const XMLMetadataSupplier & xmlMS, ImageMetadata & imd)
{
// Metadata read by GDAL
Fetch(MDTime::AcquisitionStartTime, imd, "ACQUISITION_START_TIME");
// Fetch(MDTime::AcquisitionStopTime, imd, "PROCESSING_TIME");
Fetch(MDStr::BeamMode, imd, "BEAM_MODE");
Fetch("FACILITY_IDENTIFIER", imd, "FACILITY_IDENTIFIER");
Fetch(MDNum::LineSpacing, imd, "LINE_SPACING");
Fetch(MDNum::PixelSpacing, imd, "PIXEL_SPACING");
// Fetch(MDStr::Mode, imd, "MODE");
Fetch(MDStr::OrbitDirection, imd, "ORBIT_DIRECTION");
// Fetch(MDNum::OrbitNumber, imd, "ORBIT_NUMBER");
Fetch(MDStr::ProductType, imd, "PRODUCT_TYPE");
Fetch(MDStr::Instrument, imd, "SATELLITE_IDENTIFIER");
Fetch(MDStr::SensorID, imd, "SENSOR_IDENTIFIER");
// Product file
std::string ProductFilePath = m_MetadataSupplierInterface->GetResourceFile("product.xml");
if (!ProductFilePath.empty())
{
XMLMetadataSupplier ProductMS(ProductFilePath);
imd.Add(MDStr::Mission, ProductMS.GetAs<std::string>("product.sourceAttributes.satellite"));
imd.Add(MDNum::NumberOfLines, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfLines"));
imd.Add(MDNum::NumberOfColumns, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfSamplesPerLine"));
imd.Add(MDTime::ProductionDate,
ProductMS.GetFirstAs<MetaData::Time>("product.imageGenerationParameters.generalProcessingInformation.processingTime"));
// imd.Add(MDNum::RadarFrequency, ProductMS.GetAs<double>("product.sourceAttributes.radarParameters.radarCenterFrequency"));
imd.Add(MDNum::AverageSceneHeight, ProductMS.GetAs<double>("product.imageAttributes.geographicInformation.referenceEllipsoidParameters.geodeticTerrainHeight"));
Projection::GCPParam gcp;
std::stringstream ss;
// Get the ellipsoid and semi-major, semi-minor axes
if(xmlMS.HasValue("product.imageAttributes.geographicInformation.referenceEllipsoidParameters.ellipsoidName"))
{
auto ellipsoidID = xmlMS.GetAs<std::string>("product.imageAttributes.geographicInformation.referenceEllipsoidParameters.ellipsoidName");
auto minor_axis = xmlMS.GetAs<double>(0, "product.imageAttributes.geographicInformation.referenceEllipsoidParameters.semiMinorAxis");
auto major_axis = xmlMS.GetAs<double>(0, "product.imageAttributes.geographicInformation.referenceEllipsoidParameters.semiMajorAxis");
if(ellipsoidID.empty() || minor_axis == 0 || major_axis == 0)
{
otbGenericExceptionMacro(MissingMetadataException, << "Cannot read GCP's spatial reference");
}
else if(ellipsoidID == "WGS84")
{
gcp.GCPProjection = SpatialReference::FromWGS84().ToWkt();
}
else
{
gcp.GCPProjection = SpatialReference::FromGeogCS("", "", ellipsoidID, major_axis,
major_axis/(major_axis - minor_axis)).ToWkt();
}
}
imd.Add(MDNum::RadarFrequency, this->GetRadarFrequency());
imd.Add(MDNum::PRF, this->GetPRF());
imd.Add(MDNum::RSF, this->GetRSF());
imd.Add(MDNum::CenterIncidenceAngle, this->GetCenterIncidenceAngle(ProductMS));
auto GCPCount = xmlMS.GetNumberOf("product.imageAttributes.geographicInformation.geolocationGrid.imageTiePoint");
assert(m_MetadataSupplierInterface->GetNbBands() == imd.Bands.size());
for(unsigned int i = 1 ; i <= GCPCount ; ++i)
{
ss.str("");
ss << "product.imageAttributes.geographicInformation.geolocationGrid.imageTiePoint_" << i << ".";