Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Youssefi
otb
Commits
b4e73c1b
Commit
b4e73c1b
authored
Jul 03, 2020
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: set RPCs with OssimKWL for sensor that don't use the new metadata framework yet
parent
289609b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
+23
-1
No files found.
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
View file @
b4e73c1b
...
...
@@ -1490,6 +1490,10 @@ std::cout << m_Imd << std::endl;
std
::
abs
(
geoTransform
[
4
])
>
Epsilon
||
std
::
abs
(
geoTransform
[
5
]
-
1.0
)
>
Epsilon
;
itk
::
MetaDataDictionary
&
dict
=
this
->
GetMetaDataDictionary
();
ImageKeywordlist
otb_kwl
;
itk
::
ExposeMetaData
<
ImageKeywordlist
>
(
dict
,
MetaDataKey
::
OSSIMKeywordlistKey
,
otb_kwl
);
/* -------------------------------------------------------------------- */
/* Case 1: Set the projection coordinate system of the image */
/* -------------------------------------------------------------------- */
...
...
@@ -1531,6 +1535,25 @@ std::cout << m_Imd << std::endl;
CSLDestroy
(
rpcMetadata
);
}
}
// ToDo : remove this part. This case is here for compatibility for images
// that still use Ossim for managing the sensor model (with OSSIMKeywordList).
else
if
(
otb_kwl
.
GetSize
())
{
/* -------------------------------------------------------------------- */
/* Set the RPC coeffs (since GDAL 1.10.0) */
/* -------------------------------------------------------------------- */
if
(
m_WriteRPCTags
)
{
GDALRPCInfo
gdalRpcStruct
;
if
(
otb_kwl
.
convertToGDALRPC
(
gdalRpcStruct
))
{
otbLogMacro
(
Debug
,
<<
"Saving RPC to file ("
<<
m_FileName
<<
")"
)
char
**
rpcMetadata
=
RPCInfoToMD
(
&
gdalRpcStruct
);
dataset
->
SetMetadata
(
rpcMetadata
,
"RPC"
);
CSLDestroy
(
rpcMetadata
);
}
}
}
/* -------------------------------------------------------------------- */
/* Case 3: Set the GCPs */
/* -------------------------------------------------------------------- */
...
...
@@ -1562,7 +1585,6 @@ std::cout << m_Imd << std::endl;
}
const
std
::
string
&
gcpProjectionRef
=
gcpPrm
.
GCPProjection
;
dataset
->
SetGCPs
(
gdalGcps
.
size
(),
gdalGcps
.
data
(),
gcpProjectionRef
.
c_str
());
// disable geotransform with GCP
...
...
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