mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Update algorithms for new API
This commit is contained in:
parent
86958937ad
commit
d1a71f0971
@ -90,7 +90,7 @@ class AddTableField(QgisFeatureBasedAlgorithm):
|
||||
inputFields.append(self.field)
|
||||
return inputFields
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
attributes = feature.attributes()
|
||||
attributes.append(None)
|
||||
feature.setAttributes(attributes)
|
||||
|
@ -80,7 +80,7 @@ class DeleteColumn(QgisFeatureBasedAlgorithm):
|
||||
input_fields.remove(index)
|
||||
return input_fields
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
attributes = feature.attributes()
|
||||
for index in self.field_indices:
|
||||
del attributes[index]
|
||||
|
@ -66,7 +66,7 @@ class DeleteHoles(QgisFeatureBasedAlgorithm):
|
||||
self.min_area = -1.0
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
if feature.hasGeometry():
|
||||
feature.setGeometry(feature.geometry().removeInteriorRings(self.min_area))
|
||||
return feature
|
||||
|
@ -68,7 +68,7 @@ class DensifyGeometries(QgisFeatureBasedAlgorithm):
|
||||
self.vertices = self.parameterAsInt(parameters, self.VERTICES, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
if feature.hasGeometry():
|
||||
new_geometry = feature.geometry().densifyByCount(self.vertices)
|
||||
feature.setGeometry(new_geometry)
|
||||
|
@ -64,7 +64,7 @@ class DensifyGeometriesInterval(QgisFeatureBasedAlgorithm):
|
||||
interval = self.parameterAsDouble(parameters, self.INTERVAL, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
if feature.hasGeometry():
|
||||
new_geometry = feature.geometry().densifyByDistance(float(interval))
|
||||
feature.setGeometry(new_geometry)
|
||||
|
@ -67,7 +67,7 @@ class ExtendLines(QgisFeatureBasedAlgorithm):
|
||||
self.end_distance = self.parameterAsDouble(parameters, self.END_DISTANCE, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
output_geometry = input_geometry.extendLine(self.start_distance, self.end_distance)
|
||||
|
@ -151,7 +151,7 @@ class FieldsMapper(QgisFeatureBasedAlgorithm):
|
||||
self._row_number = 0
|
||||
return super().processAlgorithm(parameters, context, feeback)
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
attributes = []
|
||||
for expression in self.expressions:
|
||||
self.expr_context.setFeature(feature)
|
||||
|
@ -101,7 +101,7 @@ class GeometryByExpression(QgisFeatureBasedAlgorithm):
|
||||
def outputWkbType(self, input_wkb_type):
|
||||
return self.wkb_type
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
self.expression_context.setFeature(feature)
|
||||
value = self.expression.evaluate(self.expression_context)
|
||||
if self.expression.hasEvalError():
|
||||
|
@ -80,7 +80,7 @@ class LinesToPolygons(QgisFeatureBasedAlgorithm):
|
||||
def outputWkbType(self, input_wkb_type):
|
||||
return self.convertWkbToPolygons(input_wkb_type)
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
if feature.hasGeometry():
|
||||
feature.setGeometry(QgsGeometry(self.convertToPolygons(feature.geometry())))
|
||||
if feature.geometry().isEmpty():
|
||||
|
@ -100,7 +100,7 @@ class OffsetLine(QgisFeatureBasedAlgorithm):
|
||||
self.miter_limit = self.parameterAsDouble(parameters, self.MITER_LIMIT, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
output_geometry = input_geometry.offsetCurve(self.distance, self.segments, self.join_style, self.miter_limit)
|
||||
|
@ -79,7 +79,7 @@ class Orthogonalize(QgisFeatureBasedAlgorithm):
|
||||
self.angle_tolerance = self.parameterAsDouble(parameters, self.ANGLE_TOLERANCE, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
output_geometry = input_geometry.orthogonalize(1.0e-8, self.max_iterations, self.angle_tolerance)
|
||||
|
@ -64,7 +64,7 @@ class PointOnSurface(QgisFeatureBasedAlgorithm):
|
||||
def outputWkbType(self, input_wkb_type):
|
||||
return QgsWkbTypes.Point
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
output_geometry = input_geometry.pointOnSurface()
|
||||
|
@ -73,7 +73,7 @@ class PolygonsToLines(QgisFeatureBasedAlgorithm):
|
||||
def outputWkbType(self, input_wkb_type):
|
||||
return self.convertWkbToLines(input_wkb_type)
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
if feature.hasGeometry():
|
||||
feature.setGeometry(QgsGeometry(self.convertToLines(feature.geometry())))
|
||||
return feature
|
||||
|
@ -54,7 +54,7 @@ class ReverseLineDirection(QgisFeatureBasedAlgorithm):
|
||||
def inputLayerTypes(self):
|
||||
return [QgsProcessing.TypeVectorLine]
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
if feature.geometry():
|
||||
inGeom = feature.geometry()
|
||||
reversedLine = inGeom.constGet().reversed()
|
||||
|
@ -71,7 +71,7 @@ class SetMValue(QgisFeatureBasedAlgorithm):
|
||||
self.m_value = self.parameterAsDouble(parameters, self.M_VALUE, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
new_geom = input_geometry.constGet().clone()
|
||||
|
@ -52,7 +52,6 @@ class SetZValue(QgisFeatureBasedAlgorithm):
|
||||
self.z_value = 0
|
||||
self.dynamic_z = False
|
||||
self.z_property = None
|
||||
self.expression_context = None
|
||||
|
||||
def name(self):
|
||||
return 'setzvalue'
|
||||
@ -82,14 +81,9 @@ class SetZValue(QgisFeatureBasedAlgorithm):
|
||||
self.dynamic_z = QgsProcessingParameters.isDynamic(parameters, self.Z_VALUE)
|
||||
if self.dynamic_z:
|
||||
self.z_property = parameters[self.Z_VALUE]
|
||||
source = self.parameterAsSource(parameters, 'INPUT', context)
|
||||
if not isinstance(source, QgsProcessingFeatureSource):
|
||||
source = None
|
||||
self.expression_context = self.createExpressionContext(parameters, context, source)
|
||||
self.z_property.prepare(self.expression_context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
new_geom = input_geometry.constGet().clone()
|
||||
@ -99,8 +93,7 @@ class SetZValue(QgisFeatureBasedAlgorithm):
|
||||
|
||||
z = self.z_value
|
||||
if self.dynamic_z:
|
||||
self.expression_context.setFeature(feature)
|
||||
z, ok = self.z_property.valueAsDouble(self.expression_context, z)
|
||||
z, ok = self.z_property.valueAsDouble(context.expressionContext(), z)
|
||||
new_geom.addZValue(z)
|
||||
|
||||
feature.setGeometry(QgsGeometry(new_geom))
|
||||
|
@ -108,7 +108,7 @@ class SingleSidedBuffer(QgisFeatureBasedAlgorithm):
|
||||
self.miter_limit = self.parameterAsDouble(parameters, self.MITER_LIMIT, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
input_geometry = feature.geometry()
|
||||
if input_geometry:
|
||||
output_geometry = input_geometry.singleSidedBuffer(self.distance, self.segments,
|
||||
|
@ -73,7 +73,7 @@ class TextToFloat(QgisFeatureBasedAlgorithm):
|
||||
self.field_name = self.parameterAsString(parameters, self.FIELD, context)
|
||||
return True
|
||||
|
||||
def processFeature(self, feature, feedback):
|
||||
def processFeature(self, feature, context, feedback):
|
||||
value = feature[self.field_idx]
|
||||
try:
|
||||
if '%' in value:
|
||||
|
@ -74,7 +74,7 @@ QgsTessellateAlgorithm *QgsTessellateAlgorithm::createInstance() const
|
||||
return new QgsTessellateAlgorithm();
|
||||
}
|
||||
|
||||
QgsFeature QgsTessellateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsTessellateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -47,7 +47,7 @@ class QgsTessellateAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QgsProcessing::SourceType outputLayerType() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -90,7 +90,7 @@ bool QgsAddIncrementalFieldAlgorithm::prepareAlgorithm( const QVariantMap ¶m
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsAddIncrementalFieldAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsAddIncrementalFieldAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
if ( !mGroupedFieldNames.empty() && mGroupedFields.empty() )
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ class QgsAddIncrementalFieldAlgorithm : public QgsProcessingFeatureBasedAlgorith
|
||||
QgsFields outputFields( const QgsFields &inputFields ) const override;
|
||||
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -68,7 +68,7 @@ bool QgsAssignProjectionAlgorithm::prepareAlgorithm( const QVariantMap ¶mete
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsAssignProjectionAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsAssignProjectionAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
return feature;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class QgsAssignProjectionAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -90,7 +90,7 @@ QgsWkbTypes::Type QgsBoundaryAlgorithm::outputWkbType( QgsWkbTypes::Type inputWk
|
||||
return outputWkb;
|
||||
}
|
||||
|
||||
QgsFeature QgsBoundaryAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsBoundaryAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
QgsFeature outFeature = feature;
|
||||
|
||||
|
@ -46,7 +46,7 @@ class QgsBoundaryAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
};
|
||||
|
||||
///@endcond PRIVATE
|
||||
|
@ -66,7 +66,7 @@ QgsFields QgsBoundingBoxAlgorithm::outputFields( const QgsFields &inputFields )
|
||||
return fields;
|
||||
}
|
||||
|
||||
QgsFeature QgsBoundingBoxAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsBoundingBoxAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -45,7 +45,7 @@ class QgsBoundingBoxAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type ) const override { return QgsWkbTypes::Polygon; }
|
||||
QgsFields outputFields( const QgsFields &inputFields ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -91,13 +91,11 @@ QVariantMap QgsBufferAlgorithm::processAlgorithm( const QVariantMap ¶meters,
|
||||
double miterLimit = parameterAsDouble( parameters, QStringLiteral( "MITER_LIMIT" ), context );
|
||||
double bufferDistance = parameterAsDouble( parameters, QStringLiteral( "DISTANCE" ), context );
|
||||
bool dynamicBuffer = QgsProcessingParameters::isDynamic( parameters, QStringLiteral( "DISTANCE" ) );
|
||||
QgsExpressionContext expressionContext;
|
||||
QgsExpressionContext expressionContext = createExpressionContext( parameters, context, dynamic_cast< QgsProcessingFeatureSource * >( source.get() ) );
|
||||
QgsProperty bufferProperty;
|
||||
if ( dynamicBuffer )
|
||||
{
|
||||
bufferProperty = parameters.value( QStringLiteral( "DISTANCE" ) ).value< QgsProperty >();
|
||||
expressionContext = createExpressionContext( parameters, context, dynamic_cast< QgsProcessingFeatureSource * >( source.get() ) );
|
||||
bufferProperty.prepare( expressionContext );
|
||||
}
|
||||
|
||||
long count = source->featureCount();
|
||||
|
@ -61,7 +61,7 @@ QgsCentroidAlgorithm *QgsCentroidAlgorithm::createInstance() const
|
||||
return new QgsCentroidAlgorithm();
|
||||
}
|
||||
|
||||
QgsFeature QgsCentroidAlgorithm::processFeature( const QgsFeature &f, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsCentroidAlgorithm::processFeature( const QgsFeature &f, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
QgsFeature feature = f;
|
||||
if ( feature.hasGeometry() )
|
||||
|
@ -48,7 +48,7 @@ class QgsCentroidAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QgsProcessing::SourceType outputLayerType() const override { return QgsProcessing::TypeVectorPoint; }
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override { Q_UNUSED( inputWkbType ); return QgsWkbTypes::Point; }
|
||||
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
};
|
||||
|
||||
///@endcond PRIVATE
|
||||
|
@ -64,7 +64,7 @@ QgsFields QgsConvexHullAlgorithm::outputFields( const QgsFields &inputFields ) c
|
||||
return fields;
|
||||
}
|
||||
|
||||
QgsFeature QgsConvexHullAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsConvexHullAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -46,7 +46,7 @@ class QgsConvexHullAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type ) const override { return QgsWkbTypes::Polygon; }
|
||||
QgsFields outputFields( const QgsFields &inputFields ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -69,7 +69,7 @@ QgsFeatureRequest QgsDropGeometryAlgorithm::request() const
|
||||
return QgsFeatureRequest().setFlags( QgsFeatureRequest::NoGeometry );
|
||||
}
|
||||
|
||||
QgsFeature QgsDropGeometryAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsDropGeometryAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
f.clearGeometry();
|
||||
|
@ -47,7 +47,7 @@ class QgsDropGeometryAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
QgsFeatureRequest request() const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
};
|
||||
|
||||
///@endcond PRIVATE
|
||||
|
@ -77,7 +77,7 @@ bool QgsDropMZValuesAlgorithm::prepareAlgorithm( const QVariantMap ¶meters,
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsDropMZValuesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsDropMZValuesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -47,7 +47,7 @@ class QgsDropMZValuesAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -67,7 +67,7 @@ QgsFixGeometriesAlgorithm *QgsFixGeometriesAlgorithm::createInstance() const
|
||||
return new QgsFixGeometriesAlgorithm();
|
||||
}
|
||||
|
||||
QgsFeature QgsFixGeometriesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsFixGeometriesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
if ( !feature.hasGeometry() )
|
||||
return feature;
|
||||
|
@ -45,7 +45,7 @@ class QgsFixGeometriesAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QgsProcessingFeatureSource::Flag sourceFlags() const override;
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type type ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -71,7 +71,7 @@ QgsMergeLinesAlgorithm *QgsMergeLinesAlgorithm::createInstance() const
|
||||
return new QgsMergeLinesAlgorithm();
|
||||
}
|
||||
|
||||
QgsFeature QgsMergeLinesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsMergeLinesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
if ( !feature.hasGeometry() )
|
||||
return feature;
|
||||
|
@ -50,7 +50,7 @@ class QgsMergeLinesAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
QgsProcessing::SourceType outputLayerType() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -81,7 +81,7 @@ bool QgsMinimumEnclosingCircleAlgorithm::prepareAlgorithm( const QVariantMap &pa
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsMinimumEnclosingCircleAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsMinimumEnclosingCircleAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -47,7 +47,7 @@ class QgsMinimumEnclosingCircleAlgorithm : public QgsProcessingFeatureBasedAlgor
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type ) const override;
|
||||
QgsFields outputFields( const QgsFields &inputFields ) const override;
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -72,7 +72,7 @@ QgsFields QgsOrientedMinimumBoundingBoxAlgorithm::outputFields( const QgsFields
|
||||
return fields;
|
||||
}
|
||||
|
||||
QgsFeature QgsOrientedMinimumBoundingBoxAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsOrientedMinimumBoundingBoxAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -45,7 +45,7 @@ class QgsOrientedMinimumBoundingBoxAlgorithm : public QgsProcessingFeatureBasedA
|
||||
QString outputName() const override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type ) const override;
|
||||
QgsFields outputFields( const QgsFields &inputFields ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -65,7 +65,7 @@ QgsWkbTypes::Type QgsPromoteToMultipartAlgorithm::outputWkbType( QgsWkbTypes::Ty
|
||||
return QgsWkbTypes::multiType( inputWkbType );
|
||||
}
|
||||
|
||||
QgsFeature QgsPromoteToMultipartAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsPromoteToMultipartAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() && !f.geometry().isMultipart() )
|
||||
|
@ -46,7 +46,7 @@ class QgsPromoteToMultipartAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -88,7 +88,7 @@ bool QgsSimplifyAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, QgsP
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsSimplifyAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsSimplifyAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -47,7 +47,7 @@ class QgsSimplifyAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
protected:
|
||||
QString outputName() const override;
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -96,7 +96,7 @@ bool QgsSmoothAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, QgsPro
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsSmoothAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsSmoothAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -47,7 +47,7 @@ class QgsSmoothAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
QgsProcessing::SourceType outputLayerType() const override;
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
int mIterations = 1;
|
||||
|
@ -85,7 +85,7 @@ bool QgsSnapToGridAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, Qg
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsSnapToGridAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsSnapToGridAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -45,7 +45,7 @@ class QgsSnapToGridAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
protected:
|
||||
QString outputName() const override;
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
double mIntervalX = 0.0;
|
||||
|
@ -71,7 +71,7 @@ QgsWkbTypes::Type QgsSubdivideAlgorithm::outputWkbType( QgsWkbTypes::Type inputW
|
||||
return QgsWkbTypes::multiType( inputWkbType );
|
||||
}
|
||||
|
||||
QgsFeature QgsSubdivideAlgorithm::processFeature( const QgsFeature &f, QgsProcessingFeedback *feedback )
|
||||
QgsFeature QgsSubdivideAlgorithm::processFeature( const QgsFeature &f, QgsProcessingContext &, QgsProcessingFeedback *feedback )
|
||||
{
|
||||
QgsFeature feature = f;
|
||||
if ( feature.hasGeometry() )
|
||||
|
@ -46,7 +46,7 @@ class QgsSubdivideAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
|
@ -73,7 +73,7 @@ bool QgsTransformAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, Qgs
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsTransformAlgorithm::processFeature( const QgsFeature &f, QgsProcessingFeedback * )
|
||||
QgsFeature QgsTransformAlgorithm::processFeature( const QgsFeature &f, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature feature = f;
|
||||
if ( !mCreatedTransform )
|
||||
|
@ -48,7 +48,7 @@ class QgsTransformAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
QString outputName() const override;
|
||||
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -82,7 +82,7 @@ bool QgsTranslateAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, Qgs
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsFeature QgsTranslateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
|
||||
QgsFeature QgsTranslateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
QgsFeature f = feature;
|
||||
if ( f.hasGeometry() )
|
||||
|
@ -45,7 +45,7 @@ class QgsTranslateAlgorithm : public QgsProcessingFeatureBasedAlgorithm
|
||||
protected:
|
||||
QString outputName() const override;
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override;
|
||||
QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user