OTB  10.0.0
Orfeo Toolbox
otbOGRIOHelper.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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  using Self = OGRIOHelper;
52  using Superclass = itk::Object;
53  using Pointer = itk::SmartPointer<Self>;
54  using ConstPointer = itk::SmartPointer<const Self>;
55 
63 
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(OGRIOHelper, itk::Object);
72 
74  void ConvertOGRLayerToDataTreeNode(VectorDataPointerType vecDataTree,OGRLayer* layer, DataNodePointerType document) const;
75 
76 
77  unsigned int ProcessNodeWrite(VectorDataConstPointerType vdata, DataNodePointerType source, GDALDataset* m_DataSource, OGRGeometryCollection* ogrCollection, OGRLayer* ogrCurrentLayer,
78  OGRSpatialReference* oSRS);
79 
81  std::vector<OGRLayer*> ConvertDataTreeNodeToOGRLayers(VectorDataConstPointerType vdata,DataNodePointerType source, GDALDataset* dummyDatasource, OGRLayer* ogrCurrentLayer,
82  OGRSpatialReference* oSRS);
83 
84  void ConvertGeometryToPointNode(const OGRGeometry* ogrGeometry, DataNodePointerType node) const;
85 
86  void ConvertGeometryToLineNode(const OGRGeometry* ogrGeometry, DataNodePointerType node) const;
87 
88  void ConvertGeometryToPolygonNode(const OGRGeometry* ogrGeometry, DataNodePointerType node) const;
89 
90 protected:
92  ~OGRIOHelper() override;
93 
94 private:
95  OGRIOHelper(const Self&) = delete;
96  void operator=(const Self&) = delete;
97 
99 
103  using VertexListConstPointerType = VertexListType::ConstPointer;
104 
109 
110 }; // end class OGRIOHelper
111 
112 } // end namespace otb
113 
114 #endif
This class represents a node of data in a vector data hierarchy.
Definition: otbDataNode.h:74
itk::SmartPointer< Self > Pointer
Definition: otbDataNode.h:79
itk::Point< PrecisionType, VDimension > PointType
Definition: otbDataNode.h:93
This class IO OGR.
void operator=(const Self &)=delete
LineType::VertexListType VertexListType
OGRIOHelper(const Self &)=delete
VectorDataType::ConstPointer VectorDataConstPointerType
PolygonType::Pointer PolygonPointerType
void ConvertGeometryToPointNode(const OGRGeometry *ogrGeometry, DataNodePointerType node) const
DataNodeType::PointType PointType
DataNodeType::Pointer DataNodePointerType
VertexListType::ConstPointer VertexListConstPointerType
void ConvertOGRLayerToDataTreeNode(VectorDataPointerType vecDataTree, OGRLayer *layer, DataNodePointerType document) const
itk::SmartPointer< Self > Pointer
std::vector< OGRLayer * > ConvertDataTreeNodeToOGRLayers(VectorDataConstPointerType vdata, DataNodePointerType source, GDALDataset *dummyDatasource, OGRLayer *ogrCurrentLayer, OGRSpatialReference *oSRS)
itk::SmartPointer< const Self > ConstPointer
unsigned int ProcessNodeWrite(VectorDataConstPointerType vdata, DataNodePointerType source, GDALDataset *m_DataSource, OGRGeometryCollection *ogrCollection, OGRLayer *ogrCurrentLayer, OGRSpatialReference *oSRS)
~OGRIOHelper() override
void ConvertGeometryToLineNode(const OGRGeometry *ogrGeometry, DataNodePointerType node) const
void ConvertGeometryToPolygonNode(const OGRGeometry *ogrGeometry, DataNodePointerType node) const
VectorDataType::DataTreeType DataTreeType
LineType::Pointer LinePointerType
VectorDataType::Pointer VectorDataPointerType
itk::Object Superclass
PolygonListType::Pointer PolygonListPointerType
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:41
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
This class implement a PolyLineParametricPath for which a value can be set. The value is stored in th...
This class represent a 2D polygon.
Definition: otbPolygon.h:45
itk::SmartPointer< Self > Pointer
Definition: otbPolygon.h:50
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:62
itk::SmartPointer< Self > Pointer
Definition: otbVectorData.h:67
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, DataNodePointerType > DataTreeType
Definition: otbVectorData.h:87
itk::SmartPointer< const Self > ConstPointer
Definition: otbVectorData.h:68
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.