Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
413f19e8
Commit
413f19e8
authored
Apr 29, 2009
by
Emmanuel Christophe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start doing it with OTB classes
parent
a5a2c506
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
mapnikOTBClasses.cxx
mapnikOTBClasses.cxx
+35
-0
No files found.
mapnikOTBClasses.cxx
View file @
413f19e8
#include "otbVectorDataFileReader.h"
#include "otbVectorData.h"
#include "otbVectorDataProjectionFilter.h"
#include <fstream>
#include <iostream>
#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbVectorDataToImageFilter.h"
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
//Read the vector data
typedef
otb
::
VectorDataFileReader
<
VectorDataType
>
VectorDataFileReaderType
;
VectorDataFileReaderType
::
Pointer
reader
=
VectorDataFileReaderType
::
New
();
reader
->
SetFileName
(
argv
[
1
]);
//Reproject the vector data in the proper projection
typedef
otb
::
VectorDataProjectionFilter
<
VectorDataType
,
VectorDataType
>
ProjectionFilterType
;
ProjectionFilterType
::
Pointer
projection
=
ProjectionFilterType
::
New
();
projection
->
SetInput
(
reader
->
GetOutput
());
// projection->Update();
//Convert the vector data into an image
typedef
itk
::
RGBAPixel
<
unsigned
char
>
PixelType
;
typedef
otb
::
Image
<
PixelType
>
ImageType
;
typedef
otb
::
VectorDataToImageFilter
<
VectorDataType
,
ImageType
>
VectorDataToImageFilterType
;
VectorDataToImageFilterType
::
Pointer
vectorDataRendering
=
VectorDataToImageFilterType
::
New
();
vectorDataRendering
->
SetInput
(
projection
->
GetOutput
());
//Save the image in a file
typedef
otb
::
ImageFileWriter
<
ImageType
>
WriterType
;
WriterType
::
Pointer
writer
=
WriterType
::
New
();
writer
->
SetInput
(
vectorDataRendering
);
writer
->
SetFileName
(
argv
[
2
]);
writer
->
Update
();
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment