VTK: IO/GDAL/vtkGDALRasterReader.h Source File

| VTK 9.3.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
25 #ifndef vtkGDALRasterReader_h
26 #define vtkGDALRasterReader_h
27
28 #include <vtkIOGDALModule.h> // For export macro
29 #include <vtkImageReader2.h>
30
31 // C++ includes
32 #include <string> // string is required
33 #include <vector> // vector is required
34
35 VTK_ABI_NAMESPACE_BEGIN
36 class VTKIOGDAL_EXPORT vtkGDALRasterReader : public vtkImageReader2
37 {
38 public:
39 static vtkGDALRasterReader* New();
40 vtkTypeMacro(vtkGDALRasterReader, vtkImageReader2);
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
43 vtkGDALRasterReader();
44 ~vtkGDALRasterReader() override;
45
49 int CanReadFile(VTK_FILEPATH const char* fname) override;
50
54 const char* GetProjectionString() const;
55
59 const char* GetProjectionWKT() const { return this->ProjectionWKT.c_str(); }
60
65 const double* GetGeoCornerPoints();
66
72 vtkSetMacro(CollateBands, bool);
73 vtkGetMacro(CollateBands, bool);
74 vtkBooleanMacro(CollateBands, bool);
75
77
80 vtkSetVector2Macro(TargetDimensions, int);
81 vtkGetVector2Macro(TargetDimensions, int);
83
85
88 int* GetRasterDimensions();
90
94 const std::vector<std::string>& GetMetaData();
95
102 double GetInvalidValue(size_t bandIndex = 0, int* hasNoData = nullptr);
103
107 std::vector<std::string> GetDomainMetaData(const std::string& domain);
108
110
113 const std::string& GetDriverShortName();
114 const std::string& GetDriverLongName();
116
120 vtkIdType GetNumberOfCells();
121
123
127 int GetNumberOfCellArrays();
128 const char* GetCellArrayName(int index);
129 int GetCellArrayStatus(const char* name);
130 void SetCellArrayStatus(const char* name, int status);
131 void DisableAllCellArrays();
132 void EnableAllCellArrays();
134
135 protected:
136 int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
137 vtkInformationVector* outputVector) override;
138
139 int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
140 vtkInformationVector* outputVector) override;
141
142 int FillOutputPortInformation(int port, vtkInformation* info) override;
143
144 int TargetDimensions[2];
145 std::string Projection;
146 std::string ProjectionWKT;
147 std::string DomainMetaData;
148 std::string DriverShortName;
149 std::string DriverLongName;
150 std::vector<std::string> Domains;
151 std::vector<std::string> MetaData;
152 bool CollateBands;
153
154 class vtkGDALRasterReaderInternal;
155 vtkGDALRasterReaderInternal* Impl;
156
157 private:
158 vtkGDALRasterReader(const vtkGDALRasterReader&) = delete;
159 void operator=(const vtkGDALRasterReader&) = delete;
160 };
161
162 VTK_ABI_NAMESPACE_END
163 #endif // vtkGDALRasterReader_h
vtkGDALRasterReader
Read raster file formats using GDAL.
Definition: vtkGDALRasterReader.h:37
vtkGDALRasterReader::DisableAllCellArrays
void DisableAllCellArrays()
The following methods allow selective reading of bands.
vtkGDALRasterReader::EnableAllCellArrays
void EnableAllCellArrays()
The following methods allow selective reading of bands.
vtkGDALRasterReader::~vtkGDALRasterReader
~vtkGDALRasterReader() override
vtkGDALRasterReader::Projection
std::string Projection
Definition: vtkGDALRasterReader.h:145
vtkGDALRasterReader::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkGDALRasterReader::GetDriverShortName
const std::string & GetDriverShortName()
Return driver name which was used to read the current data.
vtkGDALRasterReader::Impl
vtkGDALRasterReaderInternal * Impl
Definition: vtkGDALRasterReader.h:154
vtkGDALRasterReader::DomainMetaData
std::string DomainMetaData
Definition: vtkGDALRasterReader.h:147
vtkGDALRasterReader::GetDriverLongName
const std::string & GetDriverLongName()
Return driver name which was used to read the current data.
vtkGDALRasterReader::GetProjectionString
const char * GetProjectionString() const
Return proj4 spatial reference.
vtkGDALRasterReader::SetCellArrayStatus
void SetCellArrayStatus(const char *name, int status)
The following methods allow selective reading of bands.
vtkGDALRasterReader::GetNumberOfCellArrays
int GetNumberOfCellArrays()
The following methods allow selective reading of bands.
vtkGDALRasterReader::GetMetaData
const std::vector< std::string > & GetMetaData()
Return metadata as reported by GDAL.
vtkGDALRasterReader::CollateBands
bool CollateBands
Definition: vtkGDALRasterReader.h:152
vtkGDALRasterReader::GetGeoCornerPoints
const double * GetGeoCornerPoints()
Return geo-referenced corner points (Upper left, lower left, lower right, upper right)
vtkGDALRasterReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGDALRasterReader::ProjectionWKT
std::string ProjectionWKT
Definition: vtkGDALRasterReader.h:146
vtkGDALRasterReader::CanReadFile
int CanReadFile(VTK_FILEPATH const char *fname) override
Is this file supported.
vtkGDALRasterReader::GetDomainMetaData
std::vector< std::string > GetDomainMetaData(const std::string &domain)
Return domain metadata.
vtkGDALRasterReader::Domains
std::vector< std::string > Domains
Definition: vtkGDALRasterReader.h:150
vtkGDALRasterReader::MetaData
std::vector< std::string > MetaData
Definition: vtkGDALRasterReader.h:151
vtkGDALRasterReader::vtkGDALRasterReader
vtkGDALRasterReader()
vtkGDALRasterReader::DriverLongName
std::string DriverLongName
Definition: vtkGDALRasterReader.h:149
vtkGDALRasterReader::New
static vtkGDALRasterReader * New()
vtkGDALRasterReader::GetCellArrayName
const char * GetCellArrayName(int index)
The following methods allow selective reading of bands.
vtkGDALRasterReader::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
vtkGDALRasterReader::DriverShortName
std::string DriverShortName
Definition: vtkGDALRasterReader.h:148
vtkGDALRasterReader::GetNumberOfCells
vtkIdType GetNumberOfCells()
Return the number of cells that are not set to GDAL NODATA.
vtkGDALRasterReader::GetInvalidValue
double GetInvalidValue(size_t bandIndex=0, int *hasNoData=nullptr)
Return the invalid value for a pixel (for blanking purposes) in a specified raster band.
vtkGDALRasterReader::GetCellArrayStatus
int GetCellArrayStatus(const char *name)
The following methods allow selective reading of bands.
vtkGDALRasterReader::RequestInformation
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkGDALRasterReader::GetRasterDimensions
int * GetRasterDimensions()
Get raster width and height in number of pixels (cells)
vtkGDALRasterReader::GetProjectionWKT
const char * GetProjectionWKT() const
Returns WKT spatial reference.
Definition: vtkGDALRasterReader.h:59
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:57
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkImageReader2.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:34