VTK
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 =========================================================================*/
30 #ifndef vtkGDALVectorReader_h
31 #define vtkGDALVectorReader_h
32 
34 #include "vtkIOGDALModule.h" // For export macro
35 
36 #include <map> // STL required.
37 
38 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
39 {
40 public:
41  static vtkGDALVectorReader* New();
42  void PrintSelf( ostream& os, vtkIndent indent ) override;
44 
45  vtkSetStringMacro(FileName);
46  vtkGetStringMacro(FileName);
47 
51  int GetNumberOfLayers();
52 
56  int GetLayerType(int layerIndex=0);
57 
61  int GetFeatureCount(int layerIndex=0);
62 
66  int GetActiveLayerType();
67 
71  int GetActiveLayerFeatureCount();
72 
74 
79  vtkSetMacro(ActiveLayer,int);
80  vtkGetMacro(ActiveLayer,int);
82 
84 
90  vtkSetMacro(AppendFeatures, int);
91  vtkGetMacro(AppendFeatures, int);
92  vtkBooleanMacro(AppendFeatures, int);
94 
98  std::map<int, std::string> GetLayersProjection();
99 
103  const char* GetLayerProjection(int layerIndex);
104 
111  const char* GetLayerProjectionAsProj4(int layerIndex);
112 
114 
124  vtkSetMacro(AddFeatureIds,int);
125  vtkGetMacro(AddFeatureIds,int);
126  vtkBooleanMacro(AddFeatureIds,int);
128 
129 protected:
131  ~vtkGDALVectorReader() override;
132 
135 
136  int InitializeInternal();
137 
139  char* FileName;
140 
144 
145  class Internal;
146 
148  vtkGDALVectorReader::Internal* Implementation;
149 
151  static int OGRRegistered;
152 
154  std::map<int, std::string> LayersProjection;
155 
156 private:
157  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
158  void operator=(const vtkGDALVectorReader&) = delete;
159 };
160 
161 #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:33
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.