VTK  9.3.1
vtkGDALVectorReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkGDALVectorReader_h
22 #define vtkGDALVectorReader_h
23 
24 #include "vtkIOGDALModule.h" // For export macro
26 
27 #include <map> // STL required.
28 #include <string> // for ivars
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
32 {
33 public:
34  static vtkGDALVectorReader* New();
35  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
38  vtkSetFilePathMacro(FileName);
39  vtkGetFilePathMacro(FileName);
40 
44  int GetNumberOfLayers();
45 
49  int GetLayerType(int layerIndex = 0);
50 
54  int GetFeatureCount(int layerIndex = 0);
55 
59  int GetActiveLayerType();
60 
64  int GetActiveLayerFeatureCount();
65 
67 
72  vtkSetMacro(ActiveLayer, int);
73  vtkGetMacro(ActiveLayer, int);
75 
77 
83  vtkSetMacro(AppendFeatures, int);
84  vtkGetMacro(AppendFeatures, int);
85  vtkBooleanMacro(AppendFeatures, int);
87 
91  std::map<int, std::string> GetLayersProjection();
92 
96  const char* GetLayerProjection(int layerIndex);
97 
104  const char* GetLayerProjectionAsProj4(int layerIndex);
105 
107 
117  vtkSetMacro(AddFeatureIds, int);
118  vtkGetMacro(AddFeatureIds, int);
119  vtkBooleanMacro(AddFeatureIds, int);
121 
122 protected:
124  ~vtkGDALVectorReader() override;
125 
128 
129  int InitializeInternal();
130 
132  char* FileName;
133 
137 
138  class Internal;
139 
141  vtkGDALVectorReader::Internal* Implementation;
142 
144  static int OGRRegistered;
145 
147  std::map<int, std::string> LayersProjection;
148 
149 private:
150  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
151  void operator=(const vtkGDALVectorReader&) = delete;
152 };
153 
154 VTK_ABI_NAMESPACE_END
155 #endif // vtkGDALVectorReader_h
char * FileName
The name of the file that will be opened on the next call to RequestData()
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
static vtkMultiBlockDataSetAlgorithm * New()
vtkGDALVectorReader::Internal * Implementation
Private per-file metadata.
a simple class to control print indentation
Definition: vtkIndent.h:28
Read vector file formats using GDAL.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int OGRRegistered
Global variable indicating whether the OGR library has been registered yet or not.
Store zero or more vtkInformation instances.
std::map< int, std::string > LayersProjection
Mapping of layer to projection.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.