QGIS API Documentation 3.41.0-Master (3c143d501a8)
Loading...
Searching...
No Matches
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.
 
QList< LayerDatalayerData () const
 

Protected Member Functions

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

Protected Attributes

QVector< QgsInterpolatorVertexDatamCachedBaseData
 Cached vertex data for input sources.
 
bool mDataIsCached = false
 Flag that tells if the cache already has been filled.
 
QList< LayerDatamLayerData
 Information about the input vector layers and the attributes (or z-values) that are used for interpolation.
 

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

◆ SourceType

Describes the type of input data.

Enumerator
SourcePoints 

Point source.

SourceStructureLines 

Structure lines.

SourceBreakLines 

Break lines.

Definition at line 77 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 85 of file qgsinterpolator.h.

Constructor & Destructor Documentation

◆ QgsInterpolator()

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

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

Returns
Success in case of success

Definition at line 32 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)
resultinterpolation result
feedbackoptional feedback object for progress and cancellation 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 136 of file qgsinterpolator.h.

Member Data Documentation

◆ mCachedBaseData

QVector<QgsInterpolatorVertexData> QgsInterpolator::mCachedBaseData
protected

Cached vertex data for input sources.

Definition at line 152 of file qgsinterpolator.h.

◆ mDataIsCached

bool QgsInterpolator::mDataIsCached = false
protected

Flag that tells if the cache already has been filled.

Definition at line 155 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 158 of file qgsinterpolator.h.


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