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
87612adc
Commit
87612adc
authored
14 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
COMP: Reverting code that should not have been commited
parent
4a5ec76e
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
Code/Projections/otbVectorDataProjectionFilter.h
+134
-32
134 additions, 32 deletions
Code/Projections/otbVectorDataProjectionFilter.h
with
134 additions
and
32 deletions
Code/Projections/otbVectorDataProjectionFilter.h
+
134
−
32
View file @
87612adc
...
...
@@ -15,49 +15,80 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otb
ImageToEnvelope
VectorDataFilter_h
#define __otb
ImageToEnvelope
VectorDataFilter_h
#ifndef __otbVectorData
Projection
Filter_h
#define __otbVectorData
Projection
Filter_h
#include
"otbVectorDataSource.h"
#include
"otbVectorDataToVectorDataFilter.h"
#include
"itkTransform.h"
#include
"otbGenericRSTransform.h"
#include
"otbImageKeywordlist.h"
namespace
otb
{
/** \class ImageToEnvelopeVectorDataFilter
* \brief Build a vector data containing the polygon of the image envelope
/** \class VectorDataProjectionFilter
* \brief Reproject vector data in a different coordinate system
*
* This class is used to reproject vector data into a different coordinate system.
* the input and output coordinate system can be a map projection, a raw image from a
* sensor (the sensor model will be used), or the local coordinate system of an image.
*
* This filter works on otb::VectorData as input and output.
*
* The process goes as follow:
* - offset/scaling of the input coordinates
* - transform to get the data in geographic coordinates (lon/lat)
* - transform from geographic coordinates
* - offset/scaling of the output coordinates
*
* Each of this step is optional and would default to an identity transform if nothing
* is specified.
*
* The offset/scaling steps are necessary only when working with the local coordinate
* system of the image (origin on the top left). The value need to be provided by the
* SetInputSpacing, SetInputOrigin, SetOutputSpacing and SetOutputOrigin methods.
*
* The two transforms derived from itk::Transform and will be instanciated as
* otb::GenericMapProjection or otb::InverseSensorModel or otb::ForwardSensorModel
* (according to the available information).
*
* \ingroup VectorDataFilter
* \ingroup Projection
*
* \example Projections/VectorDataProjectionExample.cxx
*
*/
template
<
class
TInput
Image
,
class
TOutputVectorData
>
class
ITK_EXPORT
ImageToEnvelope
VectorDataFilter
:
public
otb
::
VectorData
Source
<
TOutputVectorData
>
template
<
class
TInput
VectorData
,
class
TOutputVectorData
>
class
ITK_EXPORT
VectorData
Projection
Filter
:
public
otb
::
VectorData
ToVectorDataFilter
<
TInputVectorData
,
TOutputVectorData
>
{
public:
/** Standard class typedefs. */
typedef
ImageToEnvelopeVectorDataFilter
Self
;
typedef
otb
::
VectorData
Source
<
TOutputVectorData
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
VectorDataProjectionFilter
Self
;
typedef
otb
::
VectorData
ToVectorDataFilter
<
TInputVectorData
,
TOutputVectorData
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
TInput
Image
Input
Image
Type
;
typedef
TOutputVectorData
OutputVectorDataType
;
typedef
typename
TInput
Image
::
ConstPointer
InputImage
Pointer
;
typedef
typename
TOutputVectorData
::
Pointer
OutputVectorDataPointer
;
typedef
TInput
VectorData
Input
VectorData
Type
;
typedef
TOutputVectorData
OutputVectorDataType
;
typedef
typename
TInput
VectorData
::
ConstPointer
InputVectorData
Pointer
;
typedef
typename
TOutputVectorData
::
Pointer
OutputVectorDataPointer
;
/** Some typedefs. */
typedef
otb
::
GenericRSTransform
<
double
,
2
,
2
>
InternalTransformType
;
typedef
typename
InternalTransformType
::
Pointer
InternalTransformPointerType
;
typedef
typename
OutputVectorDataType
::
DataNodeType
OutputDataNodeType
;
typedef
typename
OutputVectorDataType
::
DataNodePointerType
OutputDataNodePointerType
;
typedef
itk
::
Transform
<
double
,
2
,
2
>
GenericTransformType
;
typedef
typename
GenericTransformType
::
Pointer
GenericTransformPointerType
;
// typedef otb::CompositeTransform<GenericTransformType, GenericTransformType, double, 2, 2> InternalTransformType;
typedef
otb
::
GenericRSTransform
<
double
,
2
,
2
>
InternalTransformType
;
typedef
typename
InternalTransformType
::
Pointer
InternalTransformPointerType
;
typedef
itk
::
Vector
<
double
,
2
>
SpacingType
;
typedef
itk
::
Point
<
double
,
2
>
OriginType
;
typedef
typename
InputVectorDataType
::
DataNodePointerType
InputDataNodePointerType
;
typedef
typename
OutputVectorDataType
::
DataNodeType
OutputDataNodeType
;
typedef
typename
OutputVectorDataType
::
DataNodePointerType
OutputDataNodePointerType
;
typedef
typename
OutputVectorDataType
::
DataTreePointerType
OutputDataTreePointerType
;
typedef
typename
InputVectorDataType
::
DataTreeType
::
TreeNodeType
InputInternalTreeNodeType
;
...
...
@@ -71,6 +102,8 @@ public:
typedef
typename
OutputDataNodeType
::
LinePointerType
LinePointerType
;
typedef
typename
OutputDataNodeType
::
PolygonType
PolygonType
;
typedef
typename
OutputDataNodeType
::
PolygonConstPointerType
PolygonConstPointerType
;
typedef
typename
OutputDataNodeType
::
PolygonPointerType
PolygonPointerType
;
typedef
typename
OutputDataNodeType
::
PolygonListType
PolygonListType
;
typedef
typename
OutputDataNodeType
::
PolygonListConstPointerType
PolygonListConstPointerType
;
...
...
@@ -80,9 +113,12 @@ public:
itkNewMacro
(
Self
);
/** Run-time type information (and related methods). */
itkTypeMacro
(
ImageToEnvelopeVectorDataFilter
,
VectorDataSource
);
itkTypeMacro
(
VectorDataProjectionFilter
,
VectorDataToVectorDataFilter
);
/** Set/Get for input and output projections. */
itkSetStringMacro
(
InputProjectionRef
);
itkGetStringMacro
(
InputProjectionRef
);
/** Set/Get output projection (default is WGS84) */
itkSetStringMacro
(
OutputProjectionRef
);
itkGetStringMacro
(
OutputProjectionRef
);
...
...
@@ -92,28 +128,94 @@ public:
itkSetMacro
(
AverageElevation
,
double
);
itkGetMacro
(
AverageElevation
,
double
);
itkGetMacro
(
InputKeywordList
,
ImageKeywordlist
);
void
SetInputKeywordList
(
ImageKeywordlist
kwl
)
{
this
->
m_InputKeywordList
=
kwl
;
this
->
Modified
();
}
itkGetMacro
(
OutputKeywordList
,
ImageKeywordlist
);
void
SetOutputKeywordList
(
ImageKeywordlist
kwl
)
{
this
->
m_OutputKeywordList
=
kwl
;
this
->
Modified
();
}
/** Set the origin of the vector data.
* \sa GetOrigin() */
itkSetMacro
(
InputOrigin
,
OriginType
);
virtual
void
SetInputOrigin
(
const
double
origin
[
2
]);
virtual
void
SetInputOrigin
(
const
float
origin
[
2
]);
itkGetConstReferenceMacro
(
InputOrigin
,
OriginType
);
/** Set the spacing (size of a pixel) of the vector data.
* \sa GetSpacing() */
virtual
void
SetInputSpacing
(
const
SpacingType
&
spacing
);
virtual
void
SetInputSpacing
(
const
double
spacing
[
2
]);
virtual
void
SetInputSpacing
(
const
float
spacing
[
2
]);
itkGetConstReferenceMacro
(
InputSpacing
,
SpacingType
);
/** Set the origin of the vector data.
* \sa GetOrigin() */
itkSetMacro
(
OutputOrigin
,
OriginType
);
virtual
void
SetOutputOrigin
(
const
double
origin
[
2
]);
virtual
void
SetOutputOrigin
(
const
float
origin
[
2
]);
itkGetConstReferenceMacro
(
OutputOrigin
,
OriginType
);
/** Set the spacing (size of a pixel) of the vector data.
* \sa GetSpacing() */
virtual
void
SetOutputSpacing
(
const
SpacingType
&
spacing
);
virtual
void
SetOutputSpacing
(
const
double
spacing
[
2
]);
virtual
void
SetOutputSpacing
(
const
float
spacing
[
2
]);
itkGetConstReferenceMacro
(
OutputSpacing
,
SpacingType
);
protected
:
ImageToEnvelope
VectorDataFilter
();
virtual
~
ImageToEnvelope
VectorDataFilter
()
{}
VectorData
Projection
Filter
();
virtual
~
VectorData
Projection
Filter
()
{}
void
GenerateOutputInformation
(
void
);
PointType
ReprojectPoint
(
PointType
point
)
const
;
LinePointerType
ReprojectLine
(
LinePointerType
line
)
const
;
PolygonPointerType
ReprojectPolygon
(
PolygonPointerType
polygon
)
const
;
PolygonListPointerType
ReprojectPolygonList
(
PolygonListPointerType
polygonList
)
const
;
void
InstanciateTransform
(
void
);
void
GenerateOutputInformation
(
void
);
void
GenerateData
(
void
);
void
ProcessNode
(
InputInternalTreeNodeType
*
source
,
OutputInternalTreeNodeType
*
destination
);
private
:
ImageToEnvelope
VectorDataFilter
(
const
Self
&
);
//purposely not implemented
VectorData
Projection
Filter
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
InternalTransformPointerType
m_Transform
;
GenericTransformPointerType
m_InputTransform
;
GenericTransformPointerType
m_OutputTransform
;
std
::
string
m_InputProjectionRef
;
std
::
string
m_OutputProjectionRef
;
std
::
string
m_DEMDirectory
;
double
m_AverageElevation
;
ImageKeywordlist
m_InputKeywordList
;
ImageKeywordlist
m_OutputKeywordList
;
std
::
string
m_DEMDirectory
;
double
m_AverageElevation
;
SpacingType
m_InputSpacing
;
OriginType
m_InputOrigin
;
SpacingType
m_OutputSpacing
;
OriginType
m_OutputOrigin
;
};
}
// end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include
"otb
ImageToEnvelope
VectorDataFilter.txx"
#include
"otbVectorData
Projection
Filter.txx"
#endif
#endif
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