QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Public Member Functions | List of all members
QgsIDWInterpolator Class Reference

Inverse distance weight interpolator. More...

#include <qgsidwinterpolator.h>

Inheritance diagram for QgsIDWInterpolator:
Inheritance graph
[legend]

Public Member Functions

 QgsIDWInterpolator (const QList< QgsInterpolator::LayerData > &layerData)
 Constructor for QgsIDWInterpolator, with the specified layerData sources. More...
 
double distanceCoefficient () const
 Returns the distance coefficient, the parameter that sets how the values are weighted with distance. More...
 
int interpolatePoint (double x, double y, double &result, QgsFeedback *feedback=nullptr) override
 Calculates interpolation value for map coordinates x, y. More...
 
void setDistanceCoefficient (double coefficient)
 Sets the distance coefficient, the parameter that sets how the values are weighted with distance. More...
 
- Public Member Functions inherited from QgsInterpolator
 QgsInterpolator (const QList< QgsInterpolator::LayerData > &layerData)
 
virtual ~QgsInterpolator ()=default
 
QList< LayerDatalayerData () const
 

Additional Inherited Members

- Public Types inherited from QgsInterpolator
enum  Result { Success = 0, Canceled, InvalidSource, FeatureGeometryError }
 Result of an interpolation operation. More...
 
enum  SourceType { SourcePoints, SourceStructureLines, SourceBreakLines }
 Describes the type of input data. More...
 
enum  ValueSource { ValueAttribute, ValueZ, ValueM }
 Source for interpolated values from features. More...
 
- Protected Member Functions inherited from QgsInterpolator
Result cacheBaseData (QgsFeedback *feedback=nullptr)
 Caches the vertex and value data from the provider. More...
 
- Protected Attributes inherited from QgsInterpolator
QVector< QgsInterpolatorVertexDatamCachedBaseData
 Cached vertex data for input sources. More...
 
bool mDataIsCached = false
 Flag that tells if the cache already has been filled. More...
 
QList< LayerDatamLayerData
 Information about the input vector layers and the attributes (or z-values) that are used for interpolation. More...
 

Detailed Description

Inverse distance weight interpolator.

Definition at line 29 of file qgsidwinterpolator.h.

Constructor & Destructor Documentation

◆ QgsIDWInterpolator()

QgsIDWInterpolator::QgsIDWInterpolator ( const QList< QgsInterpolator::LayerData > &  layerData)

Constructor for QgsIDWInterpolator, with the specified layerData sources.

Definition at line 23 of file qgsidwinterpolator.cpp.

Member Function Documentation

◆ distanceCoefficient()

double QgsIDWInterpolator::distanceCoefficient ( ) const
inline

Returns the distance coefficient, the parameter that sets how the values are weighted with distance.

Smaller values mean sharper peaks at the data points. The default is a coefficient of 2.

Point values are weighted by 1 / ( distance ^ coefficient ).

See also
setDistanceCoefficient()
Since
QGIS 3.0

Definition at line 61 of file qgsidwinterpolator.h.

◆ interpolatePoint()

int QgsIDWInterpolator::interpolatePoint ( double  x,
double  y,
double &  result,
QgsFeedback feedback = nullptr 
)
overridevirtual

Calculates interpolation value for map coordinates x, y.

Parameters
xx-coordinate (in map units)
yy-coordinate (in map units)
resultinterpolation result
feedbackoptional feedback object for progress and cancellation support
Returns
0 in case of success

Implements QgsInterpolator.

Definition at line 27 of file qgsidwinterpolator.cpp.

◆ setDistanceCoefficient()

void QgsIDWInterpolator::setDistanceCoefficient ( double  coefficient)
inline

Sets the distance coefficient, the parameter that sets how the values are weighted with distance.

Smaller values mean sharper peaks at the data points.

Point values are weighted by 1 / ( distance ^ coefficient ).

See also
distanceCoefficient()
Since
QGIS 3.0

Definition at line 49 of file qgsidwinterpolator.h.


The documentation for this class was generated from the following files: