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
c7c61dc3
Commit
c7c61dc3
authored
13 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
ENH: replace direct use of MemoryPrintEstimator by integrated functionnality in StreamingFileWriter
parent
b264a4e6
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
Rasterization/otbRasterization.cxx
+4
-18
4 additions, 18 deletions
Rasterization/otbRasterization.cxx
with
4 additions
and
18 deletions
Rasterization/otbRasterization.cxx
+
4
−
18
View file @
c7c61dc3
...
...
@@ -259,6 +259,7 @@ int Rasterization::Execute(otb::ApplicationOptionsResult* parseResult)
{
outputImage
->
SetMetaDataDictionary
(
referenceImage
->
GetMetaDataDictionary
());
}
// Instantiate the writer
std
::
string
oFilename
=
parseResult
->
GetParameterString
(
"OutputImage"
);
...
...
@@ -266,29 +267,14 @@ int Rasterization::Execute(otb::ApplicationOptionsResult* parseResult)
oWriter
->
SetFileName
(
oFilename
);
oWriter
->
SetInput
(
outputImage
);
//Instantiate the pipeline memory print estimator
MemoryCalculatorType
::
Pointer
calculator
=
MemoryCalculatorType
::
New
();
const
double
byteToMegabyte
=
1.
/
vcl_pow
(
2.0
,
20
);
unsigned
int
ram
=
256
;
if
(
parseResult
->
IsOptionPresent
(
"AvailableMemory"
))
{
long
long
int
memory
=
static_cast
<
long
long
int
>
(
parseResult
->
GetParameterUInt
(
"AvailableMemory"
));
calculator
->
SetAvailableMemory
(
memory
/
byteToMegabyte
);
}
else
{
calculator
->
SetAvailableMemory
(
256
*
byteToMegabyte
);
ram
=
parseResult
->
GetParameterUInt
(
"AvailableMemory"
);
}
calculator
->
SetDataToWrite
(
vectorDataRendering
->
GetOutput
());
calculator
->
Compute
();
oWriter
->
SetTilingStreamDivisions
(
calculator
->
GetOptimalNumberOfStreamDivisions
());
otbMsgDevMacro
(
<<
"Guess the pipeline memory print "
<<
calculator
->
GetMemoryPrint
()
*
byteToMegabyte
<<
" Mo"
);
otbMsgDevMacro
(
<<
"Number of stream divisions : "
<<
calculator
->
GetOptimalNumberOfStreamDivisions
());
oWriter
->
SetAutomaticTiledStreaming
(
ram
);
otb
::
StandardWriterWatcher
watcher
(
oWriter
,
"Rasterization"
);
oWriter
->
Update
();
return
EXIT_SUCCESS
;
...
...
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