Commit fcca4d70 authored by Julien Osman's avatar Julien Osman

ENH: Don't write RPC twice in image file

parent 4875efa9
Pipeline #6070 passed with stages
in 128 minutes and 50 seconds
......@@ -1940,27 +1940,18 @@ void GDALImageIO::KeywordlistToMetadata(ImageMetadataBase::Keywordlist kwl, int
}
else if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::RPC))
{
// RPC Models are exported directly from the ImageMetadata.
Projection::RPCParam rpcStruct = boost::any_cast<Projection::RPCParam>(m_Imd[MDGeom::RPC]);
this->SetAs("RPC/LINE_OFF", rpcStruct.LineOffset);
this->SetAs("RPC/SAMP_OFF", rpcStruct.SampleOffset);
this->SetAs("RPC/LAT_OFF", rpcStruct.LatOffset);
this->SetAs("RPC/LONG_OFF", rpcStruct.LonOffset);
this->SetAs("RPC/HEIGHT_OFF", rpcStruct.HeightOffset);
this->SetAs("RPC/LINE_SCALE", rpcStruct.LineScale);
this->SetAs("RPC/SAMP_SCALE", rpcStruct.SampleScale);
this->SetAs("RPC/LAT_SCALE", rpcStruct.LatScale);
this->SetAs("RPC/LONG_SCALE", rpcStruct.LonScale);
this->SetAs("RPC/HEIGHT_SCALE", rpcStruct.HeightScale);
this->SetAsVector("RPC/LINE_NUM_COEFF", std::vector<double> (rpcStruct.LineNum, rpcStruct.LineNum + 20 / sizeof(double)), ' ');
this->SetAsVector("RPC/LINE_DEN_COEFF", std::vector<double> (rpcStruct.LineDen, rpcStruct.LineDen + 20 / sizeof(double)), ' ');
this->SetAsVector("RPC/SAMP_NUM_COEFF", std::vector<double> (rpcStruct.SampleNum, rpcStruct.SampleNum + 20 / sizeof(double)), ' ');
this->SetAsVector("RPC/SAMP_DEN_COEFF", std::vector<double> (rpcStruct.SampleDen, rpcStruct.SampleDen + 20 / sizeof(double)), ' ');
}
// Note that GCPs have already been exported
SetMetadataValue(kv.first.c_str(), kv.second.c_str(), band);
// RPC Models have already been exported (see InternalWriteImageInformation)
}
else if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::GCP))
{
// GCPs have already been exported (see InternalWriteImageInformation)
}
else if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::ProjectionWKT))
{
// WKT projection have already been exported (see InternalWriteImageInformation)
}
else
SetMetadataValue(kv.first.c_str(), kv.second.c_str(), band);
}
}
......
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