VTK  9.2.20221001
vtkGDALVectorReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGDALVectorReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkGDALVectorReader_h
34 #define vtkGDALVectorReader_h
35 
36 #include "vtkIOGDALModule.h" // For export macro
38 
39 #include <map> // STL required.
40 #include <string> // for ivars
41 
42 VTK_ABI_NAMESPACE_BEGIN
43 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
52 
57 
61  int GetLayerType(int layerIndex = 0);
62 
66  int GetFeatureCount(int layerIndex = 0);
67 
72 
77 
79 
84  vtkSetMacro(ActiveLayer, int);
85  vtkGetMacro(ActiveLayer, int);
87 
89 
95  vtkSetMacro(AppendFeatures, int);
96  vtkGetMacro(AppendFeatures, int);
97  vtkBooleanMacro(AppendFeatures, int);
99 
103  std::map<int, std::string> GetLayersProjection();
104 
108  const char* GetLayerProjection(int layerIndex);
109 
116  const char* GetLayerProjectionAsProj4(int layerIndex);
117 
119 
129  vtkSetMacro(AddFeatureIds, int);
130  vtkGetMacro(AddFeatureIds, int);
131  vtkBooleanMacro(AddFeatureIds, int);
133 
134 protected:
137 
140 
142 
144  char* FileName;
145 
149 
150  class Internal;
151 
153  vtkGDALVectorReader::Internal* Implementation;
154 
156  static int OGRRegistered;
157 
159  std::map<int, std::string> LayersProjection;
160 
161 private:
162  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
163  void operator=(const vtkGDALVectorReader&) = delete;
164 };
165 
166 VTK_ABI_NAMESPACE_END
167 #endif // vtkGDALVectorReader_h
Read vector file formats using GDAL.
vtkGetFilePathMacro(FileName)
static int OGRRegistered
Global variable indicating whether the OGR library has been registered yet or not.
const char * GetLayerProjection(int layerIndex)
Return projection string belonging to a layer in WKT format.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::map< int, std::string > GetLayersProjection()
Return projection string belonging to each layer in WKT format.
int GetActiveLayerType()
Return the active layer type (eg point, line, polygon).
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
char * FileName
The name of the file that will be opened on the next call to RequestData()
static vtkGDALVectorReader * New()
std::map< int, std::string > LayersProjection
Mapping of layer to projection.
int GetFeatureCount(int layerIndex=0)
Given a layer index return number of features (shapes).
vtkGDALVectorReader::Internal * Implementation
Private per-file metadata.
int GetLayerType(int layerIndex=0)
Given a index return layer type (eg point, line, polygon).
vtkSetFilePathMacro(FileName)
const char * GetLayerProjectionAsProj4(int layerIndex)
Return projection string belonging to a layer in PROJ.4 format.
int GetActiveLayerFeatureCount()
Return the number of features in the active layer (shapes).
~vtkGDALVectorReader() override
int GetNumberOfLayers()
Return number of layers.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
a simple class to control print indentation
Definition: vtkIndent.h:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.