include gdal_version and add private constructor

This commit is contained in:
Denis Rouzaud 2017-05-29 08:48:09 +02:00
parent 9b46d9dd00
commit 88a6d2ba2f
5 changed files with 24 additions and 7 deletions

View File

@ -25,6 +25,8 @@ class QgsAlignRaster
%TypeHeaderCode
#include "qgsalignraster.h"
#include <gdal_version.h>"
%End
public:
QgsAlignRaster();
@ -94,6 +96,8 @@ Get raster value at the given coordinates (from the first band)
protected:
private:
RasterInfo( const QgsAlignRaster::RasterInfo &rh );
};
@ -125,7 +129,7 @@ filename of the source raster
%Docstring
filename of the newly created aligned raster (will be overwritten if exists already)
%End
ResampleAlg resampleMethod;
QgsAlignRaster::ResampleAlg resampleMethod;
%Docstring
resampling method to be used
%End

View File

@ -39,8 +39,11 @@ class QgsZonalStatistics
typedef QFlags<QgsZonalStatistics::Statistic> Statistics;
QgsZonalStatistics( QgsVectorLayer *polygonLayer, QgsRasterLayer *rasterLayer, const QString &attributePrefix = "", int rasterBand = 1,
Statistics stats = Statistics( Count | Sum | Mean ) );
QgsZonalStatistics( QgsVectorLayer *polygonLayer,
QgsRasterLayer *rasterLayer,
const QString &attributePrefix = "",
int rasterBand = 1,
QgsZonalStatistics::Statistics stats = QgsZonalStatistics::Statistics( QgsZonalStatistics::Count | QgsZonalStatistics::Sum | QgsZonalStatistics::Mean ) );
%Docstring
Constructor for QgsZonalStatistics.
%End

View File

@ -40,6 +40,10 @@ typedef void *GDALDatasetH SIP_SKIP;
*/
class ANALYSIS_EXPORT QgsAlignRaster
{
#ifdef SIP_RUN
#include <gdal_version.h>"
#endif
public:
QgsAlignRaster();
@ -91,6 +95,9 @@ class ANALYSIS_EXPORT QgsAlignRaster
int mBandCnt;
private:
#ifdef SIP_RUN
RasterInfo( const QgsAlignRaster::RasterInfo &rh );
#endif
friend class QgsAlignRaster;
};
@ -130,7 +137,7 @@ class ANALYSIS_EXPORT QgsAlignRaster
//! filename of the newly created aligned raster (will be overwritten if exists already)
QString outputFilename;
//! resampling method to be used
ResampleAlg resampleMethod;
QgsAlignRaster::ResampleAlg resampleMethod;
//! rescaling of values according to the change of pixel size
bool rescaleValues;

View File

@ -29,7 +29,7 @@
#include <QProgressDialog>
#include <QFile>
QgsZonalStatistics::QgsZonalStatistics( QgsVectorLayer *polygonLayer, QgsRasterLayer *rasterLayer, const QString &attributePrefix, int rasterBand, Statistics stats )
QgsZonalStatistics::QgsZonalStatistics( QgsVectorLayer *polygonLayer, QgsRasterLayer *rasterLayer, const QString &attributePrefix, int rasterBand, QgsZonalStatistics::Statistics stats )
: mRasterLayer( rasterLayer )
, mRasterBand( rasterBand )
, mPolygonLayer( polygonLayer )

View File

@ -59,8 +59,11 @@ class ANALYSIS_EXPORT QgsZonalStatistics
/**
* Constructor for QgsZonalStatistics.
*/
QgsZonalStatistics( QgsVectorLayer *polygonLayer, QgsRasterLayer *rasterLayer, const QString &attributePrefix = "", int rasterBand = 1,
Statistics stats = Statistics( Count | Sum | Mean ) );
QgsZonalStatistics( QgsVectorLayer *polygonLayer,
QgsRasterLayer *rasterLayer,
const QString &attributePrefix = "",
int rasterBand = 1,
QgsZonalStatistics::Statistics stats = QgsZonalStatistics::Statistics( QgsZonalStatistics::Count | QgsZonalStatistics::Sum | QgsZonalStatistics::Mean ) );
/** Starts the calculation
\returns 0 in case of success*/