Subgroup: Interpolator

Class: QgsInterpolator

class qgis.analysis.QgsInterpolator

Bases: sip.wrapper

Interface class for interpolations. Interpolators take the vertices of a vector layer as base data. The z-Value can be an attribute or the z-coordinates in case of 3D types.

Methods

cacheBaseData Caches the vertex and value data from the provider.
interpolatePoint Calculates interpolation value for map coordinates x, y

Signals

Attributes

Canceled
FeatureGeometryError
InvalidSource
SourceBreakLines
SourcePoints
SourceStructureLines
Success
ValueAttribute
ValueM
ValueZ
Canceled = 1
FeatureGeometryError = 3
InvalidSource = 2
class LayerData

Bases: sip.wrapper

QgsInterpolator.LayerData(QgsInterpolator.LayerData)

interpolationAttribute
source
sourceType
valueSource
class Result

Bases: int

SourceBreakLines = 2
SourcePoints = 0
SourceStructureLines = 1
class SourceType

Bases: int

Success = 0
ValueAttribute = 0
ValueM = 2
class ValueSource

Bases: int

ValueZ = 1
cacheBaseData(self, feedback: QgsFeedback = None) → QgsInterpolator.Result

Caches the vertex and value data from the provider. All the vertex data will be held in virtual memory.

An optional feedback argument may be specified to allow cancelation and progress reports from the cache operation.

Returns:Success in case of success
interpolatePoint(self, x: float, y: float, feedback: QgsFeedback = None) → Tuple[int, float]

Calculates interpolation value for map coordinates x, y

Parameters:
  • x – x-coordinate (in map units)
  • y – y-coordinate (in map units)
  • result – out: interpolation result
  • feedback – optional feedback object for progress and cancelation support
Returns:

0 in case of success*