Commit 4ebf5123 authored by Julien Osman's avatar Julien Osman
Browse files

ENH: Remove the Extra. prefixe from Extra Metadata keys

parent 731c9ce5
Pipeline #8873 failed with stages
in 92 minutes and 58 seconds
...@@ -24,7 +24,7 @@ AcquisitionStartTime 2008-04-05T12:49:00.995676Z ...@@ -24,7 +24,7 @@ AcquisitionStartTime 2008-04-05T12:49:00.995676Z
SAR <SARParam> SAR <SARParam>
SARCalib <SARCalib> SARCalib <SARCalib>
GCP <GCPParam> GCP <GCPParam>
Extra.FACILITY_IDENTIFIER GATN FACILITY_IDENTIFIER GATN
GCP GCP
{"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"]]", {"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"]]",
......
...@@ -32,7 +32,7 @@ AcquisitionStopTime 2015-06-19T19:51:01.921994Z ...@@ -32,7 +32,7 @@ AcquisitionStopTime 2015-06-19T19:51:01.921994Z
SAR <SARParam> SAR <SARParam>
SARCalib <SARCalib> SARCalib <SARCalib>
GCP <GCPParam> GCP <GCPParam>
Extra.FACILITY_IDENTIFIER UPA_ FACILITY_IDENTIFIER UPA_
GCP GCP
{"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"]]", {"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"]]",
......
...@@ -16,12 +16,12 @@ SatAzimuth 102.95 ...@@ -16,12 +16,12 @@ SatAzimuth 102.95
AcquisitionDate 2012-06-05T06:30:06.4Z AcquisitionDate 2012-06-05T06:30:06.4Z
ProductionDate 2012-06-20T08:39:43.745Z ProductionDate 2012-06-20T08:39:43.745Z
RPC <RPCParam> RPC <RPCParam>
Extra.ImageID 559102101-002 ImageID 559102101-002
Extra.LinePeriod 0.2968 LinePeriod 0.2968
Extra.SwathFirstCol 3010 SwathFirstCol 3010
Extra.SwathLastCol 7298 SwathLastCol 7298
Extra.TimeRangeEnd 2012-06-05T06:30:08.7180512Z TimeRangeEnd 2012-06-05T06:30:08.7180512Z
Extra.TimeRangeStart 2012-06-05T06:30:06.5710000Z TimeRangeStart 2012-06-05T06:30:06.5710000Z
BandName B0 BandName B0
EnhancedBandName Blue EnhancedBandName Blue
PhysicalGain 9.55 PhysicalGain 9.55
......
...@@ -28,12 +28,12 @@ ProjectionWKT GEOGCS["WGS 84", ...@@ -28,12 +28,12 @@ ProjectionWKT GEOGCS["WGS 84",
AXIS["Longitude",EAST], AXIS["Longitude",EAST],
AUTHORITY["EPSG","4326"]] AUTHORITY["EPSG","4326"]]
RPC <RPCParam> RPC <RPCParam>
Extra.ImageID 559102101-002 ImageID 559102101-002
Extra.LinePeriod 0.2968 LinePeriod 0.2968
Extra.SwathFirstCol 3010 SwathFirstCol 3010
Extra.SwathLastCol 7298 SwathLastCol 7298
Extra.TimeRangeEnd 2012-06-05T06:30:08.7180512Z TimeRangeEnd 2012-06-05T06:30:08.7180512Z
Extra.TimeRangeStart 2012-06-05T06:30:06.5710000Z TimeRangeStart 2012-06-05T06:30:06.5710000Z
BandName B0 BandName B0
EnhancedBandName Blue EnhancedBandName Blue
PhysicalGain 9.55 PhysicalGain 9.55
......
...@@ -345,10 +345,9 @@ void ImageMetadataBase::ToKeywordlist(Keywordlist& kwl) const ...@@ -345,10 +345,9 @@ void ImageMetadataBase::ToKeywordlist(Keywordlist& kwl) const
kwl.emplace(MetaData::MDTimeNames.left.at(kv.first), oss.str()); kwl.emplace(MetaData::MDTimeNames.left.at(kv.first), oss.str());
} }
// Converting the ExtraKeys // Converting the ExtraKeys
std::string prefix("Extra.");
for (const auto& kv : ExtraKeys) for (const auto& kv : ExtraKeys)
{ {
kwl.emplace(prefix + kv.first, kv.second); kwl.emplace(kv.first, kv.second);
} }
} }
...@@ -451,13 +450,6 @@ bool ImageMetadataBase::FromKeywordlist(const Keywordlist& kwl) ...@@ -451,13 +450,6 @@ bool ImageMetadataBase::FromKeywordlist(const Keywordlist& kwl)
this->Add(timeKey->second, time); this->Add(timeKey->second, time);
continue; continue;
} }
// Converting the ExtraKeys
std::string prefix("Extra.");
if (kv.first.compare(0, prefix.size(), prefix) == 0)
{
this->Add(kv.first.substr(prefix.size()), kv.second);
continue;
}
otbLogMacro(Debug, << "The metadata named '" << kv.first << "' with value '" << kv.second << "' was added to ExtraKeys."); otbLogMacro(Debug, << "The metadata named '" << kv.first << "' with value '" << kv.second << "' was added to ExtraKeys.");
this->Add(kv.first, kv.second); this->Add(kv.first, kv.second);
} }
......
...@@ -71,9 +71,8 @@ void PrintMetadataBase(ImageMetadataBase imdb, std::ostream& oss) ...@@ -71,9 +71,8 @@ void PrintMetadataBase(ImageMetadataBase imdb, std::ostream& oss)
oss << It->second << ' ' << Key->second << '\n'; oss << It->second << ' ' << Key->second << '\n';
} }
std::string prefix("Extra.");
for (const auto& kv : imdb.ExtraKeys) for (const auto& kv : imdb.ExtraKeys)
oss << prefix + kv.first << ' ' << kv.second << '\n'; oss << kv.first << ' ' << kv.second << '\n';
} }
void PrintMetadata(ImageMetadata imd, std::ostream& oss) void PrintMetadata(ImageMetadata imd, std::ostream& oss)
......
Supports Markdown
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