QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
34 double sumCounter = 0;
35 double sumDenominator = 0;
39 double distance = std::sqrt( ( vertex.x - x ) * ( vertex.x - x ) + ( vertex.y - y ) * ( vertex.y - y ) );
45 double currentWeight = 1 / ( std::pow( distance, mDistanceCoefficient ) );
46 sumCounter += ( currentWeight * vertex.z );
47 sumDenominator += currentWeight;
50 if ( sumDenominator == 0.0 )
55 result = sumCounter / sumDenominator;
Interpolation data for an individual source vertex.
bool mDataIsCached
Flag that tells if the cache already has been filled.
Interface class for interpolations.
QgsIDWInterpolator(const QList< QgsInterpolator::LayerData > &layerData)
Constructor for QgsIDWInterpolator, with the specified layerData sources.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Result cacheBaseData(QgsFeedback *feedback=nullptr)
Caches the vertex and value data from the provider.
QVector< QgsInterpolatorVertexData > mCachedBaseData
Cached vertex data for input sources.
int interpolatePoint(double x, double y, double &result, QgsFeedback *feedback=nullptr) override
Calculates interpolation value for map coordinates x, y.