Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Merge requests
!13
Resolve "Inconsistent behaviour of geom file loading"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Inconsistent behaviour of geom file loading"
1507--geom-file-loading
into
develop
Overview
4
Commits
2
Pipelines
0
Changes
2
Merged
Guillaume Pasero
requested to merge
1507--geom-file-loading
into
develop
7 years ago
Overview
4
Commits
2
Pipelines
0
Changes
2
Expand
Tested on dashboard, no regression.
Closes
#1507 (closed)
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
5fc45cb6
2 commits,
7 years ago
2 files
+
25
−
55
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Modules/Adapters/OSSIMAdapters/src/otbImageKeywordlist.cxx
+
5
−
50
Options
@@ -287,60 +287,15 @@ ReadGeometryFromImage(const std::string& filename, bool checkRpcTag)
}
/**********************************************************/
/* Third try : look for
external geom file and
RPC tags */
/* Third try : look for RPC tags */
/**********************************************************/
if
(
!
hasMetaData
)
if
(
!
hasMetaData
&&
checkRpcTag
)
{
// If still no metadata, try the ".geom" file
ossimFilename
ossimGeomFile
=
ossimFilename
(
filename
).
setExtension
(
".geom"
);
otb_kwl
=
ReadGeometryFromGEOMFile
(
ossimGeomFile
);
// also check any RPC tags
ImageKeywordlist
rpc_kwl
;
if
(
checkRpcTag
)
{
rpc_kwl
=
ReadGeometryFromRPCTag
(
filename
);
}
if
(
otb_kwl
.
HasKey
(
"type"
))
{
// external geom has a "type" keyword
std
::
string
geomType
(
otb_kwl
.
GetMetadataByKey
(
"type"
));
ossimProjection
*
testProj
=
ossimProjectionFactoryRegistry
::
instance
()
->
createProjection
(
ossimString
(
geomType
));
if
(
dynamic_cast
<
ossimSensorModel
*>
(
testProj
))
{
// "type" keyword corresponds to a sensor model : don't erase it
if
(
rpc_kwl
.
GetSize
()
>
0
)
{
rpc_kwl
.
ClearMetadataByKey
(
"type"
);
}
ossimKeywordlist
ossim_test_kwl
;
otb_kwl
.
convertToOSSIMKeywordlist
(
ossim_test_kwl
);
testProj
=
ossimProjectionFactoryRegistry
::
instance
()
->
createProjection
(
ossim_test_kwl
);
if
(
testProj
)
{
// external geom contains a valid sensor geometry
hasMetaData
=
true
;
}
}
}
// check any RPC tags
otb_kwl
=
ReadGeometryFromRPCTag
(
filename
);
// copy keywords found in RPC tags if the external geom is not valid
if
(
!
hasMetaData
&&
rpc_kwl
.
GetSize
()
>
0
)
if
(
!
otb_kwl
.
Empty
())
{
const
ImageKeywordlist
::
KeywordlistMap
&
kwlMap
=
rpc_kwl
.
GetKeywordlist
();
for
(
ImageKeywordlist
::
KeywordlistMap
::
const_iterator
it
=
kwlMap
.
begin
();
it
!=
kwlMap
.
end
();
++
it
)
{
if
(
it
->
second
!=
""
)
{
otb_kwl
.
AddKey
(
it
->
first
,
it
->
second
);
}
}
hasMetaData
=
true
;
}
}
Loading