VTK  9.0.1
vtkGDALRasterReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGDALRasterReader.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 =========================================================================*/
34 #ifndef vtkGDALRasterReader_h
35 #define vtkGDALRasterReader_h
36 
37 #include <vtkIOGDALModule.h> // For export macro
38 #include <vtkImageReader2.h>
39 
40 // C++ includes
41 #include <string> // string is required
42 #include <vector> // vector is required
43 
44 class VTKIOGDAL_EXPORT vtkGDALRasterReader : public vtkImageReader2
45 {
46 public:
47  static vtkGDALRasterReader* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52  ~vtkGDALRasterReader() override;
53 
57  int CanReadFile(const char* fname) override;
58 
62  const char* GetProjectionString() const;
63 
67  const char* GetProjectionWKT() const { return this->ProjectionWKT.c_str(); }
68 
73  const double* GetGeoCornerPoints();
74 
80  vtkSetMacro(CollateBands, bool);
81  vtkGetMacro(CollateBands, bool);
82  vtkBooleanMacro(CollateBands, bool);
83 
85 
88  vtkSetVector2Macro(TargetDimensions, int);
89  vtkGetVector2Macro(TargetDimensions, int);
91 
93 
96  int* GetRasterDimensions();
98 
102  const std::vector<std::string>& GetMetaData();
103 
110  double GetInvalidValue(size_t bandIndex = 0, int* hasNoData = nullptr);
111 
115  std::vector<std::string> GetDomainMetaData(const std::string& domain);
116 
118 
121  const std::string& GetDriverShortName();
122  const std::string& GetDriverLongName();
124 
128  vtkIdType GetNumberOfCells();
129 
131 
135  int GetNumberOfCellArrays();
136  const char* GetCellArrayName(int index);
137  int GetCellArrayStatus(const char* name);
138  void SetCellArrayStatus(const char* name, int status);
139  void DisableAllCellArrays();
140  void EnableAllCellArrays();
142 
143 protected:
144  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
145  vtkInformationVector* outputVector) override;
146 
147  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
148  vtkInformationVector* outputVector) override;
149 
151 
152 protected:
153  int TargetDimensions[2];
159  std::vector<std::string> Domains;
160  std::vector<std::string> MetaData;
162 
163  class vtkGDALRasterReaderInternal;
164  vtkGDALRasterReaderInternal* Impl;
165 
166 private:
167  vtkGDALRasterReader(const vtkGDALRasterReader&) = delete;
168  void operator=(const vtkGDALRasterReader&) = delete;
169 };
170 
171 #endif // vtkGDALRasterReader_h
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
const char * GetProjectionWKT() const
Returns WKT spatial reference.
int vtkIdType
Definition: vtkType.h:338
std::vector< std::string > Domains
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkGDALRasterReaderInternal * Impl
Superclass of binary file readers.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
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.