Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
5b0d5d36
Commit
5b0d5d36
authored
Mar 23, 2021
by
Julien Osman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Set Radarsat2 IMI with new framwork
parent
e9652e77
Pipeline
#7233
canceled with stages
in 13 minutes and 12 seconds
Changes
4
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
443 additions
and
6 deletions
+443
-6
Data/Input/radarsat2/radarsat2-1.geom
Data/Input/radarsat2/radarsat2-1.geom
+403
-0
Modules/Core/Metadata/src/otbRadarsat2ImageMetadataInterface.cxx
.../Core/Metadata/src/otbRadarsat2ImageMetadataInterface.cxx
+37
-4
Modules/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx
...s/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx
+2
-2
Modules/Core/Metadata/test/CMakeLists.txt
Modules/Core/Metadata/test/CMakeLists.txt
+1
-0
No files found.
Data/Input/radarsat2/radarsat2-1.geom
0 → 100644
View file @
5b0d5d36
This diff is collapsed.
Click to expand it.
Modules/Core/Metadata/src/otbRadarsat2ImageMetadataInterface.cxx
View file @
5b0d5d36
...
...
@@ -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
)
...
...
Modules/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx
View file @
5b0d5d36
...
...
@@ -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
...
...
Modules/Core/Metadata/test/CMakeLists.txt
View file @
5b0d5d36
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment