VTK  9.7.1
vtkGDALRasterReader.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
27 #ifndef vtkGDALRasterReader_h
28 #define vtkGDALRasterReader_h
29 
30 #include <vtkIOGDALModule.h> // For export macro
31 #include <vtkImageReader2.h>
32 
33 // C++ includes
34 #include <string> // string is required
35 #include <vector> // vector is required
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class VTKIOGDAL_EXPORT vtkGDALRasterReader : public vtkImageReader2
39 {
40 public:
41  static vtkGDALRasterReader* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46  ~vtkGDALRasterReader() override;
47 
48  using Superclass::CanReadFile;
52  int CanReadFile(VTK_FILEPATH const char* fname) override;
53 
57  const char* GetProjectionString() const;
58 
62  const char* GetProjectionWKT() const { return this->ProjectionWKT.c_str(); }
63 
68  const double* GetGeoCornerPoints();
69 
75  vtkSetMacro(CollateBands, bool);
76  vtkGetMacro(CollateBands, bool);
77  vtkBooleanMacro(CollateBands, bool);
78 
80 
83  vtkSetVector2Macro(TargetDimensions, int);
84  vtkGetVector2Macro(TargetDimensions, int);
86 
88 
91  int* GetRasterDimensions();
93 
97  const std::vector<std::string>& GetMetaData();
98 
105  double GetInvalidValue(size_t bandIndex = 0, int* hasNoData = nullptr);
106 
110  std::vector<std::string> GetDomainMetaData(const std::string& domain);
111 
113 
116  const std::string& GetDriverShortName();
117  const std::string& GetDriverLongName();
119 
123  vtkIdType GetNumberOfCells();
124 
126 
130  int GetNumberOfCellArrays();
131  const char* GetCellArrayName(int index);
132  int GetCellArrayStatus(const char* name);
133  void SetCellArrayStatus(const char* name, int status);
134  void DisableAllCellArrays();
135  void EnableAllCellArrays();
137 
138 protected:
139  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
140  vtkInformationVector* outputVector) override;
141 
142  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
143  vtkInformationVector* outputVector) override;
144 
146 
147  int TargetDimensions[2];
153  std::vector<std::string> Domains;
154  std::vector<std::string> MetaData;
156 
157  class vtkGDALRasterReaderInternal;
158  vtkGDALRasterReaderInternal* Impl;
159 
160 private:
161  vtkGDALRasterReader(const vtkGDALRasterReader&) = delete;
162  void operator=(const vtkGDALRasterReader&) = delete;
163 };
164 
165 VTK_ABI_NAMESPACE_END
166 #endif // vtkGDALRasterReader_h
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
int vtkIdType
Definition: vtkType.h:363
std::vector< std::string > Domains
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkGDALRasterReaderInternal * Impl
const char * GetProjectionWKT() const
Returns WKT spatial reference.
Superclass of binary file readers.
#define VTK_FILEPATH
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual int CanReadFile(const char *fname)
Return non zero if the reader can read the given file name.
int FillOutputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
Store zero or more vtkInformation instances.
std::vector< std::string > MetaData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Read raster file formats using GDAL.