QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 65 of file qgsinterpolator.h.

Member Enumeration Documentation

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 86 of file qgsinterpolator.h.

Describes the type of input data.

Enumerator
SourcePoints 

Point source.

SourceStructureLines 

Structure lines.

SourceBreakLines 

Break lines.

Definition at line 70 of file qgsinterpolator.h.

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 78 of file qgsinterpolator.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file qgsinterpolator.cpp.

virtual QgsInterpolator::~QgsInterpolator ( )
virtualdefault

Member Function Documentation

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 cancellation and progress reports from the cache operation.

Returns
Success in case of success

Definition at line 31 of file qgsinterpolator.cpp.

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 cancellation support
Returns
0 in case of success

Implemented in QgsTinInterpolator, and QgsIDWInterpolator.

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

Definition at line 121 of file qgsinterpolator.h.

Member Data Documentation

QVector<QgsInterpolatorVertexData> QgsInterpolator::mCachedBaseData
protected

Cached vertex data for input sources.

Definition at line 137 of file qgsinterpolator.h.

bool QgsInterpolator::mDataIsCached = false
protected

Flag that tells if the cache already has been filled.

Definition at line 140 of file qgsinterpolator.h.

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 143 of file qgsinterpolator.h.


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