QgsTinInterpolator class

Interpolation in a triangular irregular network.

Base classes

class QgsInterpolator
Interface class for interpolations.

Public types

enum TinInterpolation { Linear, CloughTocher }
Indicates the type of interpolation to be performed.

Public static functions

static auto triangulationFields() -> QgsFields
Returns the fields output by features when saving the triangulation.

Constructors, destructors, conversion operators

QgsTinInterpolator(const QList<QgsInterpolator::LayerData>& inputData, TinInterpolation interpolation = Linear, QgsFeedback* feedback = nullptr)
Constructor for QgsTinInterpolator.

Public functions

auto interpolatePoint(double x, double y, double& result, QgsFeedback* feedback) -> int override
Calculates interpolation value for map coordinates x, y.
void setTriangulationSink(QgsFeatureSink* sink)
Sets the optional sink for saving the triangulation features.

Enum documentation

enum QgsTinInterpolator::TinInterpolation

Indicates the type of interpolation to be performed.

Enumerators
Linear

Linear interpolation.

CloughTocher

Clough-Tocher interpolation.

Function documentation

static QgsFields QgsTinInterpolator::triangulationFields()

Returns the fields output by features when saving the triangulation.

These fields should be used when creating a suitable feature sink for setTriangulationSink()

QgsTinInterpolator::QgsTinInterpolator(const QList<QgsInterpolator::LayerData>& inputData, TinInterpolation interpolation = Linear, QgsFeedback* feedback = nullptr)

Constructor for QgsTinInterpolator.

The feedback object specifies an optional QgsFeedback object for progress reports and cancelation support. Ownership of feedback is not transferred and callers must ensure that it exists for the lifetime of this object.

int QgsTinInterpolator::interpolatePoint(double x, double y, double& result, QgsFeedback* feedback) override

Calculates interpolation value for map coordinates x, y.

Parameters
x x-coordinate (in map units)
y y-coordinate (in map units)
result interpolation result
feedback optional feedback object for progress and cancelation support
Returns 0 in case of success

void QgsTinInterpolator::setTriangulationSink(QgsFeatureSink* sink)

Sets the optional sink for saving the triangulation features.

The sink must be setup to accept LineString features, with fields matching those returned by triangulationFields().