QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
Performs Kernel Density Estimation ("heatmap") calculations on a vector layer. More...
#include <qgskde.h>
Classes | |
struct | Parameters |
KDE parameters. More... | |
Public Types | |
enum | KernelShape { KernelQuartic = 0 , KernelTriangular , KernelUniform , KernelTriweight , KernelEpanechnikov } |
Kernel shape type. More... | |
enum | OutputValues { OutputRaw = 0 , OutputScaled } |
Output values type. More... | |
enum | Result { Success , DriverError , InvalidParameters , FileCreationError , RasterIoError } |
Result of operation. More... | |
Public Member Functions | |
QgsKernelDensityEstimation (const Parameters ¶meters, const QString &outputFile, const QString &outputFormat) | |
Constructor for QgsKernelDensityEstimation. | |
QgsKernelDensityEstimation (const QgsKernelDensityEstimation &other)=delete | |
Result | addFeature (const QgsFeature &feature) |
Adds a single feature to the KDE surface. | |
Result | finalise () |
Finalises the output file. | |
QgsKernelDensityEstimation & | operator= (const QgsKernelDensityEstimation &other)=delete |
Result | prepare () |
Prepares the output file for writing and setups up the surface calculation. | |
Result | run () |
Runs the KDE calculation across the whole layer at once. | |
Performs Kernel Density Estimation ("heatmap") calculations on a vector layer.
QgsKernelDensityEstimation::QgsKernelDensityEstimation | ( | const Parameters & | parameters, |
const QString & | outputFile, | ||
const QString & | outputFormat | ||
) |
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.
Definition at line 23 of file qgskde.cpp.
|
delete |
QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::addFeature | ( | const QgsFeature & | feature | ) |
Adds a single feature to the KDE surface.
prepare() must be called before adding features.
Definition at line 107 of file qgskde.cpp.
QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::finalise | ( | ) |
Finalises the output file.
Must be called after adding all features via addFeature().
Definition at line 206 of file qgskde.cpp.
|
delete |
QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::prepare | ( | ) |
Prepares the output file for writing and setups up the surface calculation.
This must be called before adding features via addFeature().
Definition at line 69 of file qgskde.cpp.
QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::run | ( | ) |
Runs the KDE calculation across the whole layer at once.
Either call this method, or manually call run(), addFeature() and finalise() separately.
Definition at line 44 of file qgskde.cpp.