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
f2f64079
Commit
f2f64079
authored
14 years ago
by
Patrick Imbo
Browse files
Options
Downloads
Plain Diff
MRG
parents
2c9de2a5
d355e7df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Testing/Code/IO/otbMultiDatasetReadingInfo.cxx
+21
-5
21 additions, 5 deletions
Testing/Code/IO/otbMultiDatasetReadingInfo.cxx
with
21 additions
and
5 deletions
Testing/Code/IO/otbMultiDatasetReadingInfo.cxx
+
21
−
5
View file @
f2f64079
...
...
@@ -19,6 +19,7 @@
#include
<iostream>
#include
<fstream>
#include
<string>
#include
"base/ossimFilename.h"
#include
"otbGDALImageIO.h"
...
...
@@ -50,15 +51,30 @@ int otbMultiDatasetReadingInfo(int argc, char* argv[])
if
(
readingSubDatasetInfo
==
false
)
return
EXIT_FAILURE
;
// Parse all the names to delete the path of the filename
for
(
unsigned
int
itSubDataset
=
0
;
itSubDataset
<
(
unsigned
int
)
names
.
size
();
itSubDataset
++
)
{
std
::
size_t
posDeb
=
names
[
itSubDataset
].
find
(
":
\"
"
);
if
(
posDeb
==
std
::
string
::
npos
)
return
EXIT_FAILURE
;
std
::
size_t
posEnd
=
names
[
itSubDataset
].
rfind
(
"
\"
:"
);
if
(
posEnd
==
std
::
string
::
npos
)
return
EXIT_FAILURE
;
// Remove the path from the SubDataset_name metadata
std
::
string
strFilepath
=
names
[
itSubDataset
].
substr
(
posDeb
+
2
,
posEnd
-
posDeb
-
2
);
ossimFilename
lFile
=
ossimFilename
(
strFilepath
);
names
[
itSubDataset
].
replace
(
posDeb
+
2
,
posEnd
-
posDeb
-
2
,
(
lFile
.
file
()).
c_str
()
);
}
std
::
ofstream
file
;
file
.
open
(
outputAsciiFilename
);
for
(
unsigned
int
itSubDataset
=
0
;
itSubDataset
<
names
.
size
();
itSubDataset
++
)
for
(
unsigned
int
itSubDataset
=
0
;
itSubDataset
<
(
unsigned
int
)
names
.
size
();
itSubDataset
++
)
{
file
<<
"NAME_"
<<
itSubDataset
+
1
<<
" :"
<<
names
[
itSubDataset
]
<<
std
::
endl
;
//std::cout << "NAME_"<< itSubDataset+1 << " :" << names[itSubDataset] <<std::endl;
file
<<
"DESC_"
<<
itSubDataset
+
1
<<
" :"
<<
desc
[
itSubDataset
]
<<
std
::
endl
;
//std::cout << "DESC_"<< itSubDataset+1 << " :" << desc[itSubDataset] <<std::endl;
file
<<
"NAME_"
<<
itSubDataset
+
1
<<
" :"
<<
names
[
itSubDataset
]
<<
std
::
endl
;
file
<<
"DESC_"
<<
itSubDataset
+
1
<<
" :"
<<
desc
[
itSubDataset
]
<<
std
::
endl
;
}
file
.
close
();
...
...
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