OTB  6.7.0
Orfeo Toolbox
otbVectorDataProjectionFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbVectorDataProjectionFilter_h
22 #define otbVectorDataProjectionFilter_h
23 
25 #include "otbGenericRSTransform.h"
26 #include "otbImageKeywordlist.h"
27 #include <string>
28 
29 namespace otb
30 {
31 
67 template <class TInputVectorData, class TOutputVectorData>
68 class ITK_EXPORT VectorDataProjectionFilter :
69  public otb::VectorDataToVectorDataFilter<TInputVectorData, TOutputVectorData>
70 {
71 
72 public:
78 
79  typedef TInputVectorData InputVectorDataType;
80  typedef TOutputVectorData OutputVectorDataType;
81  typedef typename TInputVectorData::ConstPointer InputVectorDataPointer;
82  typedef typename TOutputVectorData::Pointer OutputVectorDataPointer;
83 
87 // typedef otb::CompositeTransform<GenericTransformType, GenericTransformType, double, 2, 2> InternalTransformType;
90 
93 
94  typedef typename OutputVectorDataType::DataNodeType OutputDataNodeType;
95  typedef typename InputVectorDataType::DataNodeType InputDataNodeType;
96 
97  typedef typename InputVectorDataType::DataTreeType::TreeNodeType InputInternalTreeNodeType;
98  typedef typename OutputVectorDataType::DataTreeType::TreeNodeType OutputInternalTreeNodeType;
99 
101  typedef typename InputDataNodeType::LineType InputLineType;
102  typedef typename InputDataNodeType::PolygonType InputPolygonType;
103  typedef typename InputDataNodeType::PolygonListType InputPolygonListType;
104 
105  typedef typename InputLineType::Pointer InputLinePointerType;
106  typedef typename InputPolygonType::Pointer InputPolygonPointerType;
107  typedef typename InputPolygonListType::Pointer InputPolygonListPointerType;
108 
110  typedef typename OutputDataNodeType::LineType OutputLineType;
111  typedef typename OutputDataNodeType::PolygonType OutputPolygonType;
112  typedef typename OutputDataNodeType::PolygonListType OutputPolygonListType;
113 
114  typedef typename OutputLineType::Pointer OutputLinePointerType;
115  typedef typename OutputPolygonType::Pointer OutputPolygonPointerType;
116  typedef typename OutputPolygonListType::Pointer OutputPolygonListPointerType;
117 
119  itkNewMacro(Self);
120 
123 
125  itkSetStringMacro(InputProjectionRef);
126  itkGetStringMacro(InputProjectionRef);
128 
129  itkSetStringMacro(OutputProjectionRef);
130  itkGetStringMacro(OutputProjectionRef);
131 
132  itkGetMacro(InputKeywordList, ImageKeywordlist);
134  {
135  this->m_InputKeywordList = kwl;
136  this->Modified();
137  }
138 
139  itkGetMacro(OutputKeywordList, ImageKeywordlist);
141  {
142  this->m_OutputKeywordList = kwl;
143  this->Modified();
144  }
145 
148  itkSetMacro(InputOrigin, OriginType);
149  virtual void SetInputOrigin(const double origin[2]);
150  virtual void SetInputOrigin(const float origin[2]);
152 
153  itkGetConstReferenceMacro(InputOrigin, OriginType);
154 
157  virtual void SetInputSpacing(const SpacingType& spacing);
158  virtual void SetInputSpacing(const double spacing[2]);
159  virtual void SetInputSpacing(const float spacing[2]);
161 
162  itkGetConstReferenceMacro(InputSpacing, SpacingType);
163 
166  itkSetMacro(OutputOrigin, OriginType);
167  virtual void SetOutputOrigin(const double origin[2]);
168  virtual void SetOutputOrigin(const float origin[2]);
170 
171  itkGetConstReferenceMacro(OutputOrigin, OriginType);
172 
175  virtual void SetOutputSpacing(const SpacingType& spacing);
176  virtual void SetOutputSpacing(const double spacing[2]);
177  virtual void SetOutputSpacing(const float spacing[2]);
179 
180  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
181 
182 protected:
185 
186  OutputPointType ProcessPoint(InputPointType point) const override;
187  OutputLinePointerType ProcessLine(InputLinePointerType line) const override;
188  OutputPolygonPointerType ProcessPolygon(InputPolygonPointerType polygon) const override;
189  OutputPolygonListPointerType ProcessPolygonList(InputPolygonListPointerType polygonList) const override;
190 
191  virtual void InstantiateTransform(void);
192 
193  void GenerateOutputInformation(void) override;
194  void GenerateData(void) override;
195 
196 private:
197  VectorDataProjectionFilter(const Self &) = delete;
198  void operator =(const Self&) = delete;
199 
201  std::string m_InputProjectionRef;
205 
210 
211 };
212 
213 } // end namespace otb
214 
215 #ifndef OTB_MANUAL_INSTANTIATION
217 #endif
218 
219 #endif
InputPolygonListType::Pointer InputPolygonListPointerType
InputVectorDataType::DataTreeType::TreeNodeType InputInternalTreeNodeType
InputDataNodeType::PolygonType InputPolygonType
InputPolygonType::Pointer InputPolygonPointerType
InternalTransformType::Pointer InternalTransformPointerType
Storage and conversion for OSSIM metadata.
OutputDataNodeType::LineType OutputLineType
otb::VectorDataToVectorDataFilter< TInputVectorData, TOutputVectorData > Superclass
OutputVectorDataType::DataTreeType::TreeNodeType OutputInternalTreeNodeType
itk::SmartPointer< const Self > ConstPointer
GenericTransformType::Pointer GenericTransformPointerType
TOutputVectorData::Pointer OutputVectorDataPointer
OutputDataNodeType::PolygonListType OutputPolygonListType
Reproject vector data in a different coordinate system.
itk::Transform< double, 2, 2 > GenericTransformType
OutputVectorDataType::DataNodeType OutputDataNodeType
OutputPolygonListType::Pointer OutputPolygonListPointerType
InputVectorDataType::DataNodeType InputDataNodeType
otb::GenericRSTransform< double, 2, 2 > InternalTransformType
This is the class to handle generic remote sensing transform.
InputDataNodeType::PolygonListType InputPolygonListType
Base class for filters that take an VectorData as input and produce an VectorData as output...
OutputDataNodeType::PolygonType OutputPolygonType
void SetOutputKeywordList(const ImageKeywordlist &kwl)
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
TInputVectorData::ConstPointer InputVectorDataPointer
OutputPolygonType::Pointer OutputPolygonPointerType
VectorImageType::PointType PointType
Definition: mvdTypes.h:189
InputDataNodeType::PointType InputPointType
void SetInputKeywordList(const ImageKeywordlist &kwl)
OutputDataNodeType::PointType OutputPointType