OTB  6.7.0
Orfeo Toolbox
otbOGRIOHelper.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 otbOGRIOHelper_h
22 #define otbOGRIOHelper_h
23 
24 #include <vector>
25 
26 #include "otbVectorData.h"
27 
28 #include "OTBIOGDALExport.h"
29 
30 
31 class GDALDataset;
32 class OGRGeometryCollection;
33 class OGRLayer;
34 class OGRSpatialReference;
35 class OGRGeometry;
36 
37 
38 namespace otb
39 {
40 
47 class OTBIOGDAL_EXPORT OGRIOHelper: public itk::Object
48 {
49 public:
51  typedef OGRIOHelper Self;
55 
62 
65 
67  itkNewMacro(Self);
68 
70  itkTypeMacro(OGRIOHelper, itk::Object);
71 
73  void ConvertOGRLayerToDataTreeNode(OGRLayer * layer, InternalTreeNodeType * documentPtr) const;
74 
75 
76  unsigned int ProcessNodeWrite(InternalTreeNodeType * source,
77  GDALDataset * m_DataSource,
78  OGRGeometryCollection * ogrCollection,
79  OGRLayer * ogrCurrentLayer,
80  OGRSpatialReference * oSRS);
81 
83  std::vector<OGRLayer*> ConvertDataTreeNodeToOGRLayers(InternalTreeNodeType * source,
84  GDALDataset * dummyDatasource,
85  OGRLayer* ogrCurrentLayer,
86  OGRSpatialReference * oSRS);
87 
88  void ConvertGeometryToPointNode(const OGRGeometry * ogrGeometry, DataNodePointerType node) const;
89 
90  void ConvertGeometryToLineNode(const OGRGeometry * ogrGeometry, DataNodePointerType node) const;
91 
92  void ConvertGeometryToPolygonNode(const OGRGeometry * ogrGeometry, DataNodePointerType node) const;
93 
94 protected:
95  OGRIOHelper();
96  ~OGRIOHelper() override;
97 
98 private:
99  OGRIOHelper(const Self &) = delete;
100  void operator =(const Self&) = delete;
101 
103 
107  typedef VertexListType::ConstPointer VertexListConstPointerType;
108 
113 
114 }; // end class OGRIOHelper
115 
116 } // end namespace otb
117 
118 #endif
itk::SmartPointer< Self > Pointer
This class IO OGR.
DataNodeType::Pointer DataNodePointerType
DataNodeType::PolygonType PolygonType
This class implement a PolyLineParametricPath for which a value can be set. The value is stored in th...
VertexListType::ConstPointer VertexListConstPointerType
PolygonListType::Pointer PolygonListPointerType
This class represents a node of data in a vector data hierarchy.
Definition: otbDataNode.h:75
DataNodeType::PolygonListType PolygonListType
This class represent a 2D polygon.
Definition: otbPolygon.h:44
LineType::Pointer LinePointerType
LineType::VertexListType VertexListType
itk::SmartPointer< const Self > ConstPointer
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >...
Definition: otbObjectList.h:40
DataNodeType::PointType PointType
itk::Object Superclass
DataNodeType::LineType LineType
VectorData VectorDataType
DataTreeType::TreeNodeType InternalTreeNodeType
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:58
VectorDataType::DataNodeType DataNodeType
VectorDataType::DataTreeType DataTreeType
OGRIOHelper Self
PolygonType::Pointer PolygonPointerType