QGIS API Documentation  3.2.0-Bonn (bc43194)
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsInterpolator Class Referenceabstract

Interface class for interpolations. More...

#include <qgsinterpolator.h>

Inheritance diagram for QgsInterpolator:
Inheritance graph
[legend]

Classes

struct  LayerData
 A source together with the information about interpolation attribute / z-coordinate interpolation and the type (point, structure line, breakline) More...
 

Public Types

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...
 

Public Member Functions

 QgsInterpolator (const QList< QgsInterpolator::LayerData > &layerData)
 
virtual ~QgsInterpolator ()=default
 
virtual int interpolatePoint (double x, double y, double &result, QgsFeedback *feedback=nullptr)=0
 Calculates interpolation value for map coordinates x, y. More...
 
QList< LayerDatalayerData () const
 

Protected Member Functions

Result cacheBaseData (QgsFeedback *feedback=nullptr)
 Caches the vertex and value data from the provider. More...
 

Protected Attributes

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

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.

Definition at line 63 of file qgsinterpolator.h.

Member Enumeration Documentation

◆ Result

Result of an interpolation operation.

Enumerator
Success 

Operation was successful.

Canceled 

Operation was manually canceled.

InvalidSource 

Operation failed due to invalid source.

FeatureGeometryError 

Operation failed due to invalid feature geometry.

Definition at line 84 of file qgsinterpolator.h.

◆ SourceType

Describes the type of input data.

Enumerator
SourcePoints 

Point source.

SourceStructureLines 

Structure lines.

SourceBreakLines 

Break lines.

Definition at line 68 of file qgsinterpolator.h.

◆ ValueSource

Source for interpolated values from features.

Enumerator
ValueAttribute 

Take value from feature's attribute.

ValueZ 

Use feature's geometry Z values for interpolation.

ValueM 

Use feature's geometry M values for interpolation.

Definition at line 76 of file qgsinterpolator.h.

Constructor & Destructor Documentation

◆ QgsInterpolator()

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

Definition at line 25 of file qgsinterpolator.cpp.

◆ ~QgsInterpolator()

virtual QgsInterpolator::~QgsInterpolator ( )
virtualdefault

Member Function Documentation

◆ cacheBaseData()

QgsInterpolator::Result QgsInterpolator::cacheBaseData ( QgsFeedback feedback = nullptr)
protected

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

Definition at line 31 of file qgsinterpolator.cpp.

◆ interpolatePoint()

virtual int QgsInterpolator::interpolatePoint ( double  x,
double  y,
double &  result,
QgsFeedback feedback = nullptr 
)
pure virtual

Calculates interpolation value for map coordinates x, y.

Parameters
xx-coordinate (in map units)
yy-coordinate (in map units)
resultout: interpolation result
feedbackoptional feedback object for progress and cancelation support
Returns
0 in case of success

Implemented in QgsTinInterpolator, and QgsIDWInterpolator.

◆ layerData()

QList<LayerData> QgsInterpolator::layerData ( ) const
inline
Note
not available in Python bindings

Definition at line 119 of file qgsinterpolator.h.

Member Data Documentation

◆ mCachedBaseData

QVector<QgsInterpolatorVertexData> QgsInterpolator::mCachedBaseData
protected

Cached vertex data for input sources.

Definition at line 135 of file qgsinterpolator.h.

◆ mDataIsCached

bool QgsInterpolator::mDataIsCached = false
protected

Flag that tells if the cache already has been filled.

Definition at line 138 of file qgsinterpolator.h.

◆ mLayerData

QList<LayerData> QgsInterpolator::mLayerData
protected

Information about the input vector layers and the attributes (or z-values) that are used for interpolation.

Definition at line 141 of file qgsinterpolator.h.


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