This file is indexed.

/usr/include/qgis/qgszonalstatistics.h is in libqgis-dev 1.7.4+1.7.5~20120320-1.1+b1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/***************************************************************************
                          qgszonalstatistics.h  -  description
                          ----------------------------
    begin                : August 29th, 2009
    copyright            : (C) 2009 by Marco Hugentobler
    email                : marco at hugis dot net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef QGSZONALSTATISTICS_H
#define QGSZONALSTATISTICS_H

#include "qgsrectangle.h"
#include <QString>

class QgsGeometry;
class QgsVectorLayer;
class QProgressDialog;

/**A class that calculates raster statistics (count, sum, mean) for a polygon or multipolygon layer and appends the results as attributes*/
class ANALYSIS_EXPORT QgsZonalStatistics
{
  public:
    QgsZonalStatistics( QgsVectorLayer* polygonLayer, const QString& rasterFile, const QString& attributePrefix = "", int rasterBand = 1 );
    ~QgsZonalStatistics();

    /**Starts the calculation
      @return 0 in case of success*/
    int calculateStatistics( QProgressDialog* p );

  private:
    QgsZonalStatistics();
    /**Analysis what cells need to be considered to cover the bounding box of a feature
      @return 0 in case of success*/
    int cellInfoForBBox( const QgsRectangle& rasterBBox, const QgsRectangle& featureBBox, double cellSizeX, double cellSizeY,
                         int& offsetX, int& offsetY, int& nCellsX, int& nCellsY ) const;

    /**Returns statistics by considering the pixels where the center point is within the polygon (fast)*/
    void statisticsFromMiddlePointTest( void* band, QgsGeometry* poly, int pixelOffsetX, int pixelOffsetY, int nCellsX, int nCellsY, \
                                        double cellSizeX, double cellSizeY, const QgsRectangle& rasterBBox, double& sum, double& count );

    void statisticsFromMiddlePointTest_improved( void* band, QgsGeometry* poly, int pixelOffsetX, int pixelOffsetY, int nCellsX, int nCellsY, \
        double cellSizeX, double cellSizeY, const QgsRectangle& rasterBBox, double& sum, double& count );

    /**Returns statistics with precise pixel - polygon intersection test (slow) */
    void statisticsFromPreciseIntersection( void* band, QgsGeometry* poly, int pixelOffsetX, int pixelOffsetY, int nCellsX, int nCellsY, \
                                            double cellSizeX, double cellSizeY, const QgsRectangle& rasterBBox, double& sum, double& count );


    QString mRasterFilePath;
    /**Raster band to calculate statistics from (defaults to 1)*/
    int mRasterBand;
    QgsVectorLayer* mPolygonLayer;
    QString mAttributePrefix;
    /**The nodata value of the input layer*/
    float mInputNodataValue;
};

#endif // QGSZONALSTATISTICS_H