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
Julien Cabieces
otb
Commits
a81dffb5
Commit
a81dffb5
authored
12 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding options to manage streaming through extended filename
parent
27ef69ad
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/IO/otbExtendedFilenameToWriterOptions.cxx
+91
-1
91 additions, 1 deletion
Code/IO/otbExtendedFilenameToWriterOptions.cxx
Code/IO/otbExtendedFilenameToWriterOptions.h
+11
-0
11 additions, 0 deletions
Code/IO/otbExtendedFilenameToWriterOptions.h
with
102 additions
and
1 deletion
Code/IO/otbExtendedFilenameToWriterOptions.cxx
+
91
−
1
View file @
a81dffb5
...
...
@@ -32,9 +32,15 @@ ExtendedFilenameToWriterOptions
m_Options
.
writeGEOMFile
.
first
=
false
;
m_Options
.
writeGEOMFile
.
second
=
true
;
m_Options
.
gdalCreationOptions
.
first
=
false
;
m_Options
.
gdalCreationOptions
.
first
=
false
;
m_Options
.
streamingType
.
first
=
false
;
m_Options
.
streamingSizeMode
.
first
=
false
;
m_Options
.
streamingSizeValue
.
first
=
false
;
m_Options
.
optionList
.
push_back
(
"writegeom"
);
m_Options
.
optionList
.
push_back
(
"streaming:type"
);
m_Options
.
optionList
.
push_back
(
"streaming:sizemode"
);
m_Options
.
optionList
.
push_back
(
"streaming:sizevalue"
);
}
void
...
...
@@ -42,6 +48,7 @@ ExtendedFilenameToWriterOptions
::
SetExtendedFileName
(
const
char
*
extFname
)
{
this
->
m_FilenameHelper
->
SetExtendedFileName
(
extFname
);
// TODO: Rename map to a less confusing (with std::map) name
MapType
map
=
this
->
m_FilenameHelper
->
GetOptionMap
();
m_Options
.
simpleFileName
.
first
=
true
;
...
...
@@ -52,6 +59,7 @@ ExtendedFilenameToWriterOptions
{
std
::
vector
<
std
::
string
>
tmp
;
boost
::
split
(
tmp
,
it
->
first
,
boost
::
is_any_of
(
":"
),
boost
::
token_compress_on
);
if
(
tmp
.
size
()
>
2
)
if
((
tmp
[
0
]
==
"gdal"
)
&&
(
tmp
[
1
]
==
"co"
))
{
...
...
@@ -73,6 +81,43 @@ ExtendedFilenameToWriterOptions
m_Options
.
writeGEOMFile
.
second
=
false
;
}
}
if
(
!
map
[
"streaming:type"
].
empty
())
{
if
(
map
[
"streaming:type"
]
==
"auto"
||
map
[
"streaming:type"
]
==
"tiled"
||
map
[
"streaming:type"
]
==
"stripped"
||
map
[
"streaming:type"
]
==
"none"
)
{
m_Options
.
streamingType
.
first
=
true
;
m_Options
.
streamingType
.
second
=
map
[
"streaming:type"
];
}
else
{
itkWarningMacro
(
"Unkwown value "
<<
map
[
"streaming:type"
]
<<
" for streaming:type option. Available values are auto,tiled,stripped."
);
}
}
if
(
!
map
[
"streaming:sizemode"
].
empty
())
{
if
(
map
[
"streaming:sizemode"
]
==
"auto"
||
map
[
"streaming:sizemode"
]
==
"nbsplits"
||
map
[
"streaming:sizemode"
]
==
"height"
)
{
m_Options
.
streamingSizeMode
.
first
=
true
;
m_Options
.
streamingSizeMode
.
second
=
map
[
"streaming:sizemode"
];
}
else
{
itkWarningMacro
(
"Unkwown value "
<<
map
[
"streaming:sizemode"
]
<<
" for streaming:sizemode option. Available values are auto,nbsplits,height."
);
}
}
if
(
!
map
[
"streaming:sizevalue"
].
empty
())
{
m_Options
.
streamingSizeValue
.
first
=
true
;
m_Options
.
streamingSizeValue
.
second
=
atof
(
map
[
"streaming:sizevalue"
].
c_str
());
}
//Option Checking
for
(
it
=
map
.
begin
();
it
!=
map
.
end
();
it
++
)
...
...
@@ -140,4 +185,49 @@ ExtendedFilenameToWriterOptions
return
m_Options
.
gdalCreationOptions
.
second
;
}
bool
ExtendedFilenameToWriterOptions
::
StreamingTypeIsSet
()
const
{
return
m_Options
.
streamingType
.
first
;
}
bool
ExtendedFilenameToWriterOptions
::
StreamingSizeModeIsSet
()
const
{
return
m_Options
.
streamingSizeMode
.
first
;
}
bool
ExtendedFilenameToWriterOptions
::
StreamingSizeValueIsSet
()
const
{
return
m_Options
.
streamingSizeValue
.
first
;
}
std
::
string
ExtendedFilenameToWriterOptions
::
GetStreamingType
()
const
{
return
m_Options
.
streamingType
.
second
;
}
std
::
string
ExtendedFilenameToWriterOptions
::
GetStreamingSizeMode
()
const
{
return
m_Options
.
streamingSizeMode
.
second
;
}
double
ExtendedFilenameToWriterOptions
::
GetStreamingSizeValue
()
const
{
return
m_Options
.
streamingSizeValue
.
second
;
}
}
// end namespace otb
This diff is collapsed.
Click to expand it.
Code/IO/otbExtendedFilenameToWriterOptions.h
+
11
−
0
View file @
a81dffb5
...
...
@@ -53,11 +53,16 @@ public:
/** The writer option structure. */
typedef
GDALImageIO
::
GDALCreationOptionsType
GDALCOType
;
struct
OptionType
{
std
::
pair
<
bool
,
std
::
string
>
simpleFileName
;
std
::
pair
<
bool
,
bool
>
writeGEOMFile
;
std
::
pair
<
bool
,
GDALCOType
>
gdalCreationOptions
;
std
::
pair
<
bool
,
std
::
string
>
streamingType
;
std
::
pair
<
bool
,
std
::
string
>
streamingSizeMode
;
std
::
pair
<
bool
,
double
>
streamingSizeValue
;
std
::
vector
<
std
::
string
>
optionList
;
};
...
...
@@ -70,6 +75,12 @@ public:
bool
GetWriteGEOMFile
()
const
;
bool
gdalCreationOptionsIsSet
()
const
;
GDALCOType
GetgdalCreationOptions
()
const
;
bool
StreamingTypeIsSet
()
const
;
std
::
string
GetStreamingType
()
const
;
bool
StreamingSizeModeIsSet
()
const
;
std
::
string
GetStreamingSizeMode
()
const
;
bool
StreamingSizeValueIsSet
()
const
;
double
GetStreamingSizeValue
()
const
;
protected
:
ExtendedFilenameToWriterOptions
();
...
...
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