VTK  9.2.6
vtkGDALRasterConverter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGDALRasterConverter.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 =========================================================================*/
25 #ifndef vtkGDALRasterConverter_h
26 #define vtkGDALRasterConverter_h
27 
28 #include "vtkGeovisGDALModule.h" // For export macro
29 #include "vtkObject.h"
30 
31 // Forward declarations
32 class GDALDataset;
33 class vtkImageData;
34 class vtkUniformGrid;
35 
36 class VTKGEOVISGDAL_EXPORT vtkGDALRasterConverter : public vtkObject
37 {
38 public:
39  static vtkGDALRasterConverter* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
48  vtkSetMacro(NoDataValue, double);
49  vtkGetMacro(NoDataValue, double);
51 
57  GDALDataset* CreateGDALDataset(int xDim, int yDim, int vtkDataType, int numberOfBands);
58 
64  GDALDataset* CreateGDALDataset(vtkImageData* data, const char* mapProjection, int flipAxis[3]);
65 
69  void CopyBandInfo(GDALDataset* src, GDALDataset* dest);
70 
76  vtkUniformGrid* CreateVTKUniformGrid(GDALDataset* input);
77 
82  void SetGDALProjection(GDALDataset* dataset, const char* projectionString);
83 
87  void SetGDALGeoTransform(
88  GDALDataset* dataset, double origin[2], double spacing[2], int flipAxis[2]);
89 
93  void CopyNoDataValues(GDALDataset* src, GDALDataset* dest);
94 
98  void WriteTifFile(GDALDataset* dataset, VTK_FILEPATH const char* filename);
99 
105  bool FindDataRange(GDALDataset* dataset, int bandId, double* minValue, double* maxValue);
106 
107 protected:
109  ~vtkGDALRasterConverter() override;
110 
111  double NoDataValue;
112 
117  bool CopyToGDAL(vtkImageData* input, GDALDataset* output, int flipAxis[3]);
118 
119  class vtkGDALRasterConverterInternal;
120  vtkGDALRasterConverterInternal* Internal;
121 
122 private:
124  void operator=(const vtkGDALRasterConverter&) = delete;
125 };
126 
127 #endif // vtkGDALRasterConverter_h
abstract base class for most VTK objects
Definition: vtkObject.h:62
Convert between VTK image representation and GDAL datasets.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGDALRasterConverterInternal * Internal
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
image data with blanking
#define VTK_FILEPATH
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...