OTB  9.0.0
Orfeo Toolbox
otbOGRIOHelper.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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;
52  typedef itk::Object Superclass;
53  typedef itk::SmartPointer<Self> Pointer;
54  typedef itk::SmartPointer<const Self> ConstPointer;
55 
61  typedef DataTreeType::TreeNodeType InternalTreeNodeType;
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, GDALDataset* m_DataSource, OGRGeometryCollection* ogrCollection, OGRLayer* ogrCurrentLayer,
77  OGRSpatialReference* oSRS);
78 
80  std::vector<OGRLayer*> ConvertDataTreeNodeToOGRLayers(InternalTreeNodeType* source, GDALDataset* dummyDatasource, OGRLayer* ogrCurrentLayer,
81  OGRSpatialReference* oSRS);
82 
83  void ConvertGeometryToPointNode(const OGRGeometry* ogrGeometry, DataNodePointerType node) const;
84 
85  void ConvertGeometryToLineNode(const OGRGeometry* ogrGeometry, DataNodePointerType node) const;
86 
87  void ConvertGeometryToPolygonNode(const OGRGeometry* ogrGeometry, DataNodePointerType node) const;
88 
89 protected:
90  OGRIOHelper();
91  ~OGRIOHelper() override;
92 
93 private:
94  OGRIOHelper(const Self&) = delete;
95  void operator=(const Self&) = delete;
96 
98 
102  typedef VertexListType::ConstPointer VertexListConstPointerType;
103 
108 
109 }; // end class OGRIOHelper
110 
111 } // end namespace otb
112 
113 #endif
otb::OGRIOHelper::PolygonListPointerType
PolygonListType::Pointer PolygonListPointerType
Definition: otbOGRIOHelper.h:107
otb::DataNode::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbDataNode.h:79
otb::OGRIOHelper
This class IO OGR.
Definition: otbOGRIOHelper.h:47
otb::DataNode::PointType
itk::Point< PrecisionType, VDimension > PointType
Definition: otbDataNode.h:93
otb::OGRIOHelper::Self
OGRIOHelper Self
Definition: otbOGRIOHelper.h:51
otb::VectorData
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:58
otb::DataNode
This class represents a node of data in a vector data hierarchy.
Definition: otbDataNode.h:73
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::OGRIOHelper::LinePointerType
LineType::Pointer LinePointerType
Definition: otbOGRIOHelper.h:100
otb::OGRIOHelper::VertexListType
LineType::VertexListType VertexListType
Definition: otbOGRIOHelper.h:101
otb::OGRIOHelper::DataNodePointerType
DataNodeType::Pointer DataNodePointerType
Definition: otbOGRIOHelper.h:64
otb::OGRIOHelper::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbOGRIOHelper.h:53
otb::ObjectList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
otb::OGRIOHelper::VertexListConstPointerType
VertexListType::ConstPointer VertexListConstPointerType
Definition: otbOGRIOHelper.h:102
otb::VectorData::DataTreeType
itk::TreeContainer< DataNodePointerType > DataTreeType
Definition: otbVectorData.h:79
otb::OGRIOHelper::PolygonType
DataNodeType::PolygonType PolygonType
Definition: otbOGRIOHelper.h:104
otb::OGRIOHelper::Superclass
itk::Object Superclass
Definition: otbOGRIOHelper.h:52
otb::OGRIOHelper::PolygonPointerType
PolygonType::Pointer PolygonPointerType
Definition: otbOGRIOHelper.h:105
otb::PolyLineParametricPathWithValue::VertexListType
Superclass::VertexListType VertexListType
Definition: otbPolyLineParametricPathWithValue.h:70
otb::OGRIOHelper::DataTreeType
VectorDataType::DataTreeType DataTreeType
Definition: otbOGRIOHelper.h:60
otb::PolyLineParametricPathWithValue::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPolyLineParametricPathWithValue.h:56
otb::Polygon::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPolygon.h:50
otb::PolyLineParametricPathWithValue
This class implement a PolyLineParametricPath for which a value can be set. The value is stored in th...
Definition: otbPolyLineParametricPathWithValue.h:50
otbVectorData.h
otb::Polygon
This class represent a 2D polygon.
Definition: otbPolygon.h:44
otb::OGRIOHelper::InternalTreeNodeType
DataTreeType::TreeNodeType InternalTreeNodeType
Definition: otbOGRIOHelper.h:61
otb::OGRIOHelper::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbOGRIOHelper.h:54
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::OGRIOHelper::VectorDataType
VectorData VectorDataType
Definition: otbOGRIOHelper.h:59
otb::OGRIOHelper::LineType
DataNodeType::LineType LineType
Definition: otbOGRIOHelper.h:99
otb::OGRIOHelper::PolygonListType
DataNodeType::PolygonListType PolygonListType
Definition: otbOGRIOHelper.h:106
otb::OGRIOHelper::PointType
DataNodeType::PointType PointType
Definition: otbOGRIOHelper.h:97
otb::OGRIOHelper::DataNodeType
VectorDataType::DataNodeType DataNodeType
Definition: otbOGRIOHelper.h:63