VTK
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,
58  int yDim,
59  int vtkDataType,
60  int numberOfBands);
61 
67  GDALDataset* CreateGDALDataset(vtkImageData* data, const char* mapProjection);
68 
72  void CopyBandInfo(GDALDataset* src, GDALDataset* dest);
73 
79  vtkUniformGrid* CreateVTKUniformGrid(GDALDataset* input);
80 
85  void SetGDALProjection(GDALDataset* dataset, const char* projectionString);
86 
90  void SetGDALGeoTransform(GDALDataset* dataset,
91  double origin[2],
92  double spacing[2]);
93 
97  void CopyNoDataValues(GDALDataset* src, GDALDataset* dest);
98 
102  void WriteTifFile(GDALDataset* dataset, const char* filename);
103 
109  bool FindDataRange(GDALDataset* dataset,
110  int bandId,
111  double* minValue,
112  double* maxValue);
113 
114 protected:
117 
118  double NoDataValue;
119 
124  bool CopyToGDAL(vtkImageData* input, GDALDataset* output);
125 
126  class vtkGDALRasterConverterInternal;
127  vtkGDALRasterConverterInternal* Internal;
128 
129 private:
131  void operator=(const vtkGDALRasterConverter&) = delete;
132 };
133 
134 #endif // vtkGDALRasterConverter_h
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:45
image data with blanking
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...