00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OMGGDAL_H
00021 #define OMGGDAL_H
00022
00023 #include <QObject>
00024 #include "gdal_priv.h"
00025 class QString;
00026
00030 struct BandStats {
00031 QString bandName;
00032 int bandNo;
00033 double minValDouble;
00034 double maxValDouble;
00035
00036 double rangeDouble;
00037 double meanDouble;
00038 double sumSqrDevDouble;
00039 double stdDevDouble;
00040 double sumDouble;
00041 int elementCountInt;
00042 double noDataDouble;
00043 };
00044
00045 int CPL_STDCALL progressCallback( double dfComplete, const char *pszMessage,
00046 void * pProgressArg );
00047
00052 class OMG_LIB_EXPORT OmgGdal : public QObject
00053 {
00054 Q_OBJECT;
00055
00056 public:
00057
00058 enum FileType {GeoTiff,ArcInfoAscii};
00059
00060 OmgGdal();
00061 ~OmgGdal();
00062
00063 const QString getWorldFile(const QString theFileName) ;
00064 const QString getAsciiHeader(const QString theFileName) ;
00073 const bool convert(const QString theInputFile, const QString theOutputFileName, const FileType theOutputFileType) ;
00074
00084
00085
00091 void buildSupportedRasterFileFilter(QString & theFileFiltersString);
00092
00099 const QString contour(const QString theInputFile);
00104 void showProgress (int theProgress,int theMaximum);
00110 static bool isValidGdalFile(const QString theFilename);
00116 static bool isValidGdalProj(const QString theFilename);
00117
00125 void writeImage(QString theInputFileString,
00126 QString theOutputFileString,
00127 int theWidth,
00128 int theHeight);
00132 const bool makeLegend(const QString theOutputFileName, const int theWidth);
00138 const bool gdal2gdal(const QString theFileName,
00139 const QString theOutputFileName,
00140 const QString theFormat);
00141 const bool gdal2Tiff(const QString theFileName, const QString theOutputFileName);
00142 const bool gdal2Ascii(const QString theFileName, const QString theOutputFileName);
00143 signals:
00144 void error (QString theError);
00150 void updateProgress (int theProgress,int theMaximum);
00151
00152 private:
00153
00155 void calculateStats(BandStats * theBandStats,GDALDataset * gdalDataset);
00156
00157 };
00158 #endif //OMGGDAL_H