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
4a703abe
Commit
4a703abe
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: cleaning
parent
71e0e2b2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/Code/Common/otbVectorDataToImageFilter.cxx
+8
-14
8 additions, 14 deletions
Testing/Code/Common/otbVectorDataToImageFilter.cxx
Testing/Code/Projections/otbVectorDataProjectionFilterFromMapToSensor.cxx
+1
-1
1 addition, 1 deletion
...jections/otbVectorDataProjectionFilterFromMapToSensor.cxx
with
9 additions
and
15 deletions
Testing/Code/Common/otbVectorDataToImageFilter.cxx
+
8
−
14
View file @
4a703abe
...
...
@@ -28,13 +28,16 @@
#include
"otbImage.h"
#include
"otbVectorDataToImageFilter.h"
// ./mapnikOTBClasses /home/christop/OTB/trunk/OTB-Data/Input/waterways.shp output.png
// ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/Input/ToulouseRoad-examples.shp output.png
// ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/LargeInput/VECTOR/MidiPyrenees/roads.shp output.png
int
otbVectorDataToImageFilter
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
3
)
{
std
::
cout
<<
argv
[
0
]
<<
" <input vector filename> <input image filename>"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
//Read the vector data
typedef
otb
::
VectorData
<>
VectorDataType
;
typedef
otb
::
VectorDataFileReader
<
VectorDataType
>
VectorDataFileReaderType
;
...
...
@@ -46,7 +49,7 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
typedef
otb
::
VectorDataProjectionFilter
<
VectorDataType
,
VectorDataType
>
ProjectionFilterType
;
ProjectionFilterType
::
Pointer
projection
=
ProjectionFilterType
::
New
();
projection
->
SetInput
(
reader
->
GetOutput
());
// projection->Update();
std
::
string
projectionRefWkt
=
"PROJCS[
\"
UTM Zone 31, Northern Hemisphere
\"
,GEOGCS[
\"
WGS 84
\"
,DATUM[
\"
WGS_1984
\"
,SPHEROID[
\"
WGS 84
\"
,6378137,298.257223563,AUTHORITY[
\"
EPSG
\"
,
\"
7030
\"
]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[
\"
EPSG
\"
,
\"
6326
\"
]],PRIMEM[
\"
Greenwich
\"
,0,AUTHORITY[
\"
EPSG
\"
,
\"
8901
\"
]],UNIT[
\"
degree
\"
,0.0174532925199433,AUTHORITY[
\"
EPSG
\"
,
\"
9108
\"
]],AXIS[
\"
Lat
\"
,NORTH],AXIS[
\"
Long
\"
,EAST],AUTHORITY[
\"
EPSG
\"
,
\"
4326
\"
]],PROJECTION[
\"
Transverse_Mercator
\"
],PARAMETER[
\"
latitude_of_origin
\"
,0],PARAMETER[
\"
central_meridian
\"
,3],PARAMETER[
\"
scale_factor
\"
,0.9996],PARAMETER[
\"
false_easting
\"
,500000],PARAMETER[
\"
false_northing
\"
,0],UNIT[
\"
Meter
\"
,1]]"
;
projection
->
SetOutputProjectionRef
(
projectionRefWkt
);
...
...
@@ -59,20 +62,14 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
typedef
otb
::
Image
<
PixelType
,
2
>
ImageType
;
ImageType
::
SizeType
size
;
// size[0] = 1000;
// size[1] = 1000;
size
[
0
]
=
500
;
size
[
1
]
=
500
;
ImageType
::
PointType
origin
;
// origin[0] = 1.3769;//UL lon
// origin[1] = 43.5455;//UL lat
origin
[
0
]
=
374149.980555821
;
//UL easting
origin
[
1
]
=
4829183.99443839
;
//UL northing
ImageType
::
SpacingType
spacing
;
// spacing[0] = 0.00002;
// spacing[1] = -0.00002;
spacing
[
0
]
=
0.6
;
spacing
[
1
]
=
-
0.6
;
...
...
@@ -98,7 +95,6 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
vectorDataRendering
->
SetOrigin
(
origin
);
vectorDataRendering
->
SetSpacing
(
spacing
);
//Save the image in a file
typedef
otb
::
ImageFileWriter
<
ImageType
>
WriterType
;
WriterType
::
Pointer
writer
=
WriterType
::
New
();
...
...
@@ -106,7 +102,5 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
writer
->
SetFileName
(
argv
[
2
]);
writer
->
Update
();
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Testing/Code/Projections/otbVectorDataProjectionFilterFromMapToSensor.cxx
+
1
−
1
View file @
4a703abe
...
...
@@ -27,7 +27,7 @@
int
otbVectorDataProjectionFilterFromMapToSensor
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
3
)
if
(
argc
<
4
)
{
std
::
cout
<<
argv
[
0
]
<<
" <input vector filename> <input image filename>"
<<
" <output vector filename> "
<<
std
::
endl
;
...
...
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