QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
26 : mLayerData( layerData )
58 switch ( layer.valueSource )
61 attList.push_back( layer.interpolationAttribute );
69 double attributeValue = 0.0;
70 bool attributeConversionOk =
false;
71 double progress = layerCount * layerStep;
82 progress += featureStep;
86 switch ( layer.valueSource )
90 QVariant attributeVariant = feature.
attribute( layer.interpolationAttribute );
91 if ( !attributeVariant.isValid() )
95 attributeValue = attributeVariant.toDouble( &attributeConversionOk );
96 if ( !attributeConversionOk || std::isnan( attributeValue ) )
108 if ( !addVerticesToCache( feature.
geometry(), layer.valueSource, attributeValue ) )
117 bool QgsInterpolator::addVerticesToCache(
const QgsGeometry &geom, ValueSource source,
double attributeValue )
void setProgress(double progress)
Sets the current progress for the feedback object.
@ FeatureGeometryError
Operation failed due to invalid feature geometry.
@ ValueAttribute
Take value from feature's attribute.
@ Success
Operation was successful.
Interpolation data for an individual source vertex.
bool mDataIsCached
Flag that tells if the cache already has been filled.
const QgsCoordinateReferenceSystem & crs
A source together with the information about interpolation attribute / z-coordinate interpolation and...
@ ValueZ
Use feature's geometry Z values for interpolation.
QList< LayerData > mLayerData
Information about the input vector layers and the attributes (or z-values) that are used for interpol...
QList< int > QgsAttributeList
QgsInterpolator(const QList< QgsInterpolator::LayerData > &layerData)
@ Canceled
Operation was manually canceled.
@ InvalidSource
Operation failed due to invalid source.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const =0
Returns an iterator for the features in the source.
Result cacheBaseData(QgsFeedback *feedback=nullptr)
Caches the vertex and value data from the provider.
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
bool isEmpty() const
Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geom...
QVector< QgsInterpolatorVertexData > mCachedBaseData
Cached vertex data for input sources.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
Result
Result of an interpolation operation.
virtual long featureCount() const =0
Returns the number of features contained in the source, or -1 if the feature count is unknown.
bool isCanceled() const
Tells whether the operation has been canceled already.
bool nextFeature(QgsFeature &f)
bool isMeasure() const
Returns true if the geometry contains m values.
@ ValueM
Use feature's geometry M values for interpolation.
QgsAbstractGeometry::vertex_iterator vertices_end() const
Returns STL-style iterator pointing to the imaginary vertex after the last vertex of the geometry.
QgsAbstractGeometry::vertex_iterator vertices_begin() const
Returns STL-style iterator pointing to the first vertex of the geometry.