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
13da113b
Commit
13da113b
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: setting the output size
parent
7bac4c50
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mapnikOTBClasses.cxx
+4
-0
4 additions, 0 deletions
mapnikOTBClasses.cxx
otbVectorDataToImageFilter.h
+6
-0
6 additions, 0 deletions
otbVectorDataToImageFilter.h
otbVectorDataToImageFilter.txx
+13
-5
13 additions, 5 deletions
otbVectorDataToImageFilter.txx
with
23 additions
and
5 deletions
mapnikOTBClasses.cxx
+
4
−
0
View file @
13da113b
...
...
@@ -33,6 +33,10 @@ int main(int argc, char * argv[])
typedef
otb
::
VectorDataToImageFilter
<
VectorDataType
,
ImageType
>
VectorDataToImageFilterType
;
VectorDataToImageFilterType
::
Pointer
vectorDataRendering
=
VectorDataToImageFilterType
::
New
();
vectorDataRendering
->
SetInput
(
projection
->
GetOutput
());
ImageType
::
SizeType
size
;
size
[
0
]
=
100
;
size
[
1
]
=
100
;
vectorDataRendering
->
SetSize
(
size
);
//Save the image in a file
...
...
This diff is collapsed.
Click to expand it.
otbVectorDataToImageFilter.h
+
6
−
0
View file @
13da113b
...
...
@@ -69,6 +69,12 @@ template <class TVectorData, class TImage>
virtual
void
SetInput
(
const
VectorDataType
*
input
);
const
VectorDataType
*
GetInput
(
void
);
/** Set the size of the output image. */
itkSetMacro
(
Size
,
SizeType
);
/** Get the size of the output image. */
itkGetConstReferenceMacro
(
Size
,
SizeType
);
/** Set the origin of the vector data.
* \sa GetOrigin() */
itkSetMacro
(
Origin
,
OriginType
);
...
...
This diff is collapsed.
Click to expand it.
otbVectorDataToImageFilter.txx
+
13
−
5
View file @
13da113b
...
...
@@ -32,6 +32,11 @@ namespace otb
::VectorDataToImageFilter()
{
this->SetNumberOfRequiredInputs( 1 );
m_Spacing.Fill(1.0);
m_Origin.Fill(0.0);
m_Direction.SetIdentity();
m_Size.Fill( 0 );
m_StartIndex.Fill( 0 );
}
...
...
@@ -130,27 +135,30 @@ namespace otb
VectorDataToImageFilter<TVectorData, TImage>
::GenerateOutputInformation()
{
// call the superclass' implementation of this method
Superclass::GenerateOutputInformation();
// get pointers to the input and output
// we can't call the superclass method here.
// get pointers to the input and output
ImagePointer outputPtr = this->GetOutput();
if ( !outputPtr )
{
return;
}
// Set the size of the output region
// Set the size of the output region
typename TImage::RegionType outputLargestPossibleRegion;
outputLargestPossibleRegion.SetSize( m_Size );
outputLargestPossibleRegion.SetIndex( m_StartIndex );
outputPtr->SetLargestPossibleRegion( outputLargestPossibleRegion );
// Set spacing and origin
// Set spacing and origin
outputPtr->SetSpacing( m_Spacing );
outputPtr->SetOrigin( m_Origin );
outputPtr->SetDirection( m_Direction );
//TODO update or check the projection information
return;
}
...
...
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