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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
David Youssefi
otb
Commits
d7f3fcda
Commit
d7f3fcda
authored
12 years ago
by
Aurélien Bricier
Browse files
Options
Downloads
Patches
Plain Diff
ENH: adapted ReadGeometryFromImage to use ReadGeometryFromGEOMFile
parent
f2459bce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/UtilitiesAdapters/OssimAdapters/otbImageKeywordlist.cxx
+5
-25
5 additions, 25 deletions
Code/UtilitiesAdapters/OssimAdapters/otbImageKeywordlist.cxx
with
5 additions
and
25 deletions
Code/UtilitiesAdapters/OssimAdapters/otbImageKeywordlist.cxx
+
5
−
25
View file @
d7f3fcda
...
...
@@ -159,6 +159,7 @@ ReadGeometryFromImage(const std::string& filename)
// Trying to read ossim MetaData
bool
hasMetaData
=
false
;
ossimKeywordlist
geom_kwl
;
// = new ossimKeywordlist();
ImageKeywordlist
otb_kwl
;
// Test the plugins factory
/** Before, the pluginfactory was tested if the ossim one returned false.
...
...
@@ -177,6 +178,7 @@ ReadGeometryFromImage(const std::string& filename)
otbMsgDevMacro
(
<<
"OSSIM Instantiate projection SUCCESS ! "
);
hasMetaData
=
projection
->
saveState
(
geom_kwl
);
otb_kwl
.
SetKeywordlist
(
geom_kwl
);
// Free memory
delete
projection
;
...
...
@@ -210,28 +212,7 @@ ReadGeometryFromImage(const std::string& filename)
// Try to find a ".geom" file next to 'filename'
ossimFilename
ossimGeomFile
=
ossimFilename
(
filename
).
setExtension
(
".geom"
);
if
(
ossimGeomFile
.
exists
()
&&
ossimGeomFile
.
isFile
())
{
// Interpret the geom file as a KWL
ossimKeywordlist
kwl
(
ossimGeomFile
);
// Check that the geom file results in a valid ossimKeywordlist
if
(
kwl
.
getErrorStatus
()
==
ossimErrorCodes
::
OSSIM_OK
)
{
// Be sure there is a corresponding instance of ossimSensorModel
// which understands this kwl
SensorModelAdapter
::
Pointer
sensorModel
=
SensorModelAdapter
::
New
();
ImageKeywordlist
otbkwl
;
otbkwl
.
SetKeywordlist
(
kwl
);
sensorModel
->
CreateProjection
(
otbkwl
);
if
(
sensorModel
->
IsValidSensorModel
())
{
geom_kwl
=
kwl
;
}
}
}
otb_kwl
=
ReadGeometryFromGEOMFile
(
ossimGeomFile
);
}
else
{
...
...
@@ -249,6 +230,7 @@ ReadGeometryFromImage(const std::string& filename)
if
(
projection
)
{
hasMetaData
=
projection
->
saveState
(
geom_kwl
);
otb_kwl
.
SetKeywordlist
(
geom_kwl
);
}
}
}
...
...
@@ -266,9 +248,6 @@ ReadGeometryFromImage(const std::string& filename)
otbMsgDevMacro
(
<<
geom_kwl
);
}
ImageKeywordlist
otb_kwl
;
otb_kwl
.
SetKeywordlist
(
geom_kwl
);
return
otb_kwl
;
}
...
...
@@ -277,6 +256,7 @@ ReadGeometryFromGEOMFile(const std::string& filename)
{
ossimKeywordlist
geom_kwl
;
ImageKeywordlist
otb_kwl
;
ossimFilename
ossimGeomFile
=
ossimFilename
(
filename
);
if
(
ossimGeomFile
.
exists
()
&&
ossimGeomFile
.
isFile
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment