2017-06-21 09:55:29 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/raster/qgskde.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-26 15:43:24 +10:00
|
|
|
class QgsKernelDensityEstimation
|
|
|
|
{
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Performs Kernel Density Estimation ("heatmap") calculations on a vector layer.
|
|
|
|
.. versionadded:: 3.0
|
2016-10-26 15:43:24 +10:00
|
|
|
%End
|
|
|
|
|
2017-06-21 09:55:29 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgskde.h"
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum KernelShape
|
|
|
|
{
|
2017-06-21 09:55:29 +02:00
|
|
|
KernelQuartic,
|
|
|
|
KernelTriangular,
|
|
|
|
KernelUniform,
|
|
|
|
KernelTriweight,
|
|
|
|
KernelEpanechnikov,
|
2016-10-26 15:43:24 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
enum OutputValues
|
|
|
|
{
|
2017-06-21 09:55:29 +02:00
|
|
|
OutputRaw,
|
|
|
|
OutputScaled,
|
2016-10-26 15:43:24 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
enum Result
|
|
|
|
{
|
2017-06-21 09:55:29 +02:00
|
|
|
Success,
|
|
|
|
DriverError,
|
|
|
|
InvalidParameters,
|
|
|
|
FileCreationError,
|
|
|
|
RasterIoError,
|
2016-10-26 15:43:24 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Parameters
|
|
|
|
{
|
2017-07-13 20:04:31 +10:00
|
|
|
QgsFeatureSource *source;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
2017-07-13 20:04:31 +10:00
|
|
|
Point feature source
|
2017-06-21 09:55:29 +02:00
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
double radius;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Fixed radius, in map units
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
QString radiusField;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Field for radius, or empty if using a fixed radius
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
QString weightField;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Field name for weighting field, or empty if not using weights
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
double pixelSize;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Size of pixel in output file
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
QgsKernelDensityEstimation::KernelShape shape;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Kernel shape
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
double decayRatio;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Decay ratio (Triangular kernels only)
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
QgsKernelDensityEstimation::OutputValues outputValues;
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Type of output value
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
};
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsKernelDensityEstimation( const Parameters ¶meters, const QString &outputFile, const QString &outputFormat );
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsKernelDensityEstimation. Requires a Parameters object specifying the options to use
|
|
|
|
to generate the surface. The output path and file format are also required.
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
Result run();
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Runs the KDE calculation across the whole layer at once. Either call this method, or manually
|
|
|
|
call run(), addFeature() and finalise() separately.
|
|
|
|
:rtype: Result
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
Result prepare();
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Prepares the output file for writing and setups up the surface calculation. This must be called
|
|
|
|
before adding features via addFeature().
|
|
|
|
.. seealso:: addFeature()
|
|
|
|
.. seealso:: finalise()
|
|
|
|
:rtype: Result
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
Result addFeature( const QgsFeature &feature );
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Adds a single feature to the KDE surface. prepare() must be called before adding features.
|
|
|
|
.. seealso:: prepare()
|
|
|
|
.. seealso:: finalise()
|
|
|
|
:rtype: Result
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
Result finalise();
|
2017-06-21 09:55:29 +02:00
|
|
|
%Docstring
|
|
|
|
Finalises the output file. Must be called after adding all features via addFeature().
|
|
|
|
.. seealso:: prepare()
|
|
|
|
.. seealso:: addFeature()
|
|
|
|
:rtype: Result
|
|
|
|
%End
|
2016-10-26 15:43:24 +10:00
|
|
|
|
|
|
|
};
|
2017-06-21 09:55:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/raster/qgskde.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|