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
afb4d70f
Commit
afb4d70f
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: moving KML overly output from otbQuicklook to otbReadImageInfo
parent
05f4bcbb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Utils/otbQuicklook.cxx
+3
-53
3 additions, 53 deletions
Utils/otbQuicklook.cxx
with
3 additions
and
53 deletions
Utils/otbQuicklook.cxx
+
3
−
53
View file @
afb4d70f
...
...
@@ -35,9 +35,7 @@ PURPOSE. See the above copyright notices for more information.
#include
"otbStreamingImageFileWriter.h"
#include
"otbConfigure.h"
#include
"otbPolygon.h"
#include
"otbVectorData.h"
#include
"otbVectorDataFileWriter.h"
int
main
(
int
argc
,
char
*
argv
[]
)
{
...
...
@@ -45,8 +43,8 @@ int main(int argc, char* argv[] )
try
{
typedef
int
InputPixelType
;
typedef
unsigned
char
OutputPixelType
;
typedef
double
InputPixelType
;
typedef
double
OutputPixelType
;
typedef
otb
::
MultiChannelExtractROI
<
InputPixelType
,
...
...
@@ -74,7 +72,6 @@ int main(int argc, char* argv[] )
parser
->
AddOption
(
"--SamplingRatio"
,
"Sampling Ratio "
,
"-sr"
,
1
,
false
);
parser
->
AddOption
(
"--kmlOutput"
,
"KML overlay file (experimental)"
,
"-kml"
,
1
,
false
);
typedef
otb
::
CommandLineArgumentParseResult
ParserResultType
;
ParserResultType
::
Pointer
parseResult
=
ParserResultType
::
New
();
...
...
@@ -223,53 +220,6 @@ int main(int argc, char* argv[] )
writer
->
Update
();
if
(
parseResult
->
IsOptionPresent
(
"--kmlOutput"
))
{
typedef
otb
::
Polygon
<>
PolygonType
;
PolygonType
::
Pointer
polygon
=
PolygonType
::
New
();
int
numberOfGCP
=
reader
->
GetOutput
()
->
GetGCPCount
();
for
(
int
i
=
0
;
i
<
numberOfGCP
;
++
i
)
{
PolygonType
::
VertexType
point
;
point
[
0
]
=
reader
->
GetOutput
()
->
GetGCPX
(
i
);
point
[
1
]
=
reader
->
GetOutput
()
->
GetGCPY
(
i
);
polygon
->
AddVertex
(
point
);
}
//Write the polygon (kml file)
typedef
otb
::
VectorData
<>
VectorDataType
;
VectorDataType
::
Pointer
data
=
VectorDataType
::
New
();
typedef
VectorDataType
::
DataNodeType
DataNodeType
;
DataNodeType
::
Pointer
document
=
DataNodeType
::
New
();
DataNodeType
::
Pointer
folder
=
DataNodeType
::
New
();
document
->
SetNodeType
(
otb
::
DOCUMENT
);
folder
->
SetNodeType
(
otb
::
FOLDER
);
document
->
SetNodeId
(
"DOCUMENT"
);
folder
->
SetNodeId
(
"FOLDER"
);
DataNodeType
::
Pointer
root
=
data
->
GetDataTree
()
->
GetRoot
()
->
Get
();
data
->
GetDataTree
()
->
Add
(
document
,
root
);
data
->
GetDataTree
()
->
Add
(
folder
,
document
);
DataNodeType
::
Pointer
polygonNode
=
DataNodeType
::
New
();
polygonNode
->
SetNodeType
(
otb
::
FEATURE_POLYGON
);
polygonNode
->
SetNodeId
(
"FEATURE_POLYGON"
);
polygonNode
->
SetPolygonExteriorRing
(
polygon
);
data
->
GetDataTree
()
->
Add
(
polygonNode
,
folder
);
typedef
otb
::
VectorDataFileWriter
<
VectorDataType
>
WriterVectorType
;
WriterVectorType
::
Pointer
writerVector
=
WriterVectorType
::
New
();
writerVector
->
SetFileName
(
parseResult
->
GetParameterString
(
"--kmlOutput"
));
writerVector
->
SetInput
(
data
);
writerVector
->
Update
();
}
}
catch
(
itk
::
ExceptionObject
&
err
)
...
...
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