OTB  9.0.0
Orfeo Toolbox
otbPersistentImageToOGRLayerFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbPersistentImageToOGRLayerFilter_h
23 #define otbPersistentImageToOGRLayerFilter_h
24 
26 
28 #include "otbOGRLayerWrapper.h"
29 
30 #include "itkMacro.h"
31 #include <string>
32 
33 namespace otb
34 {
35 
50 template <class TImage>
51 class ITK_EXPORT PersistentImageToOGRLayerFilter : public PersistentImageFilter<TImage, TImage>
52 {
53 public:
57  typedef itk::SmartPointer<Self> Pointer;
58  typedef itk::SmartPointer<const Self> ConstPointer;
59 
62 
63  typedef TImage InputImageType;
64  typedef typename InputImageType::Pointer InputImagePointer;
65  typedef typename InputImageType::RegionType RegionType;
66  typedef typename InputImageType::SizeType SizeType;
67  typedef typename InputImageType::IndexType IndexType;
68  typedef typename InputImageType::PixelType PixelType;
69  typedef typename InputImageType::InternalPixelType InternalPixelType;
70 
75 
76  void AllocateOutputs() override;
77  void Reset(void) override;
78  void Synthetize(void) override;
79 
83  virtual void Initialize(void);
84 
89  itkGetMacro(StreamSize, SizeType);
90 
92  void SetOGRLayer(const OGRLayerType& ogrLayer);
93 
95  const OGRLayerType& GetOGRLayer(void) const;
96 
97 protected:
100 
101  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
102 
103  void GenerateData() override;
104 
105 
106 private:
107  PersistentImageToOGRLayerFilter(const Self&) = delete;
108  void operator=(const Self&) = delete;
109 
110  virtual OGRDataSourcePointerType ProcessTile() = 0;
111 
112  // The layer where to dump geometries
114 
116 }; // end of class
117 } // end namespace otb
118 
119 #ifndef OTB_MANUAL_INSTANTIATION
121 #endif
122 
123 #endif
otb::PersistentImageToOGRLayerFilter::Superclass
PersistentImageFilter< TImage, TImage > Superclass
Definition: otbPersistentImageToOGRLayerFilter.h:56
otb::PersistentImageToOGRLayerFilter::PixelType
InputImageType::PixelType PixelType
Definition: otbPersistentImageToOGRLayerFilter.h:68
otbPersistentImageFilter.h
otbPersistentImageToOGRLayerFilter.hxx
otb::PersistentImageFilter
This filter is the base class for all filter persisting data through multiple update....
Definition: otbPersistentImageFilter.h:47
otb::PersistentImageToOGRLayerFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbPersistentImageToOGRLayerFilter.h:58
otb::PersistentImageToOGRLayerFilter::OGRDataSourcePointerType
OGRDataSourceType::Pointer OGRDataSourcePointerType
Definition: otbPersistentImageToOGRLayerFilter.h:72
otbOGRLayerWrapper.h
otb::PersistentImageToOGRLayerFilter::RegionType
InputImageType::RegionType RegionType
Definition: otbPersistentImageToOGRLayerFilter.h:65
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ogr::DataSource
Collection of geometric objects.
Definition: otbOGRDataSourceWrapper.h:83
otb::PersistentImageToOGRLayerFilter::m_OGRLayer
OGRLayerType m_OGRLayer
Definition: otbPersistentImageToOGRLayerFilter.h:113
otb::PersistentImageToOGRLayerFilter::OGRDataSourceType
ogr::DataSource OGRDataSourceType
Definition: otbPersistentImageToOGRLayerFilter.h:71
otb::PersistentImageToOGRLayerFilter::InputImageType
TImage InputImageType
Definition: otbPersistentImageToOGRLayerFilter.h:61
otb::PersistentImageToOGRLayerFilter::Self
PersistentImageToOGRLayerFilter Self
Definition: otbPersistentImageToOGRLayerFilter.h:55
otb::PersistentImageToOGRLayerFilter::OGRFeatureType
ogr::Feature OGRFeatureType
Definition: otbPersistentImageToOGRLayerFilter.h:74
otbLabelImageToOGRDataSourceFilter.h
otb::ogr::DataSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbOGRDataSourceWrapper.h:90
otb::PersistentImageToOGRLayerFilter::InternalPixelType
InputImageType::InternalPixelType InternalPixelType
Definition: otbPersistentImageToOGRLayerFilter.h:69
otb::PersistentImageToOGRLayerFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbPersistentImageToOGRLayerFilter.h:66
otb::PersistentImageToOGRLayerFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPersistentImageToOGRLayerFilter.h:57
otb::PersistentImageToOGRLayerFilter::IndexType
InputImageType::IndexType IndexType
Definition: otbPersistentImageToOGRLayerFilter.h:67
otb::PersistentImageToOGRLayerFilter::OGRLayerType
ogr::Layer OGRLayerType
Definition: otbPersistentImageToOGRLayerFilter.h:73
otb::ogr::Feature
Geometric object with descriptive fields.
Definition: otbOGRFeatureWrapper.h:63
otb::ogr::Layer
Layer of geometric objects.
Definition: otbOGRLayerWrapper.h:80
otb::PersistentImageToOGRLayerFilter
Perform vectorization in a persistent way.
Definition: otbPersistentImageToOGRLayerFilter.h:51
otb::PersistentImageToOGRLayerFilter::m_StreamSize
SizeType m_StreamSize
Definition: otbPersistentImageToOGRLayerFilter.h:115
otb::PersistentImageToOGRLayerFilter::InputImagePointer
InputImageType::Pointer InputImagePointer
Definition: otbPersistentImageToOGRLayerFilter.h:64