Skip to content

Commit fd2c18e

Browse files
committedApr 26, 2017
Refactor processing writer to use QgsFeatureSink, and to store
temporary output layers in the provided processing context Should fix loss of intermediate memory layers when running a multi-step model
1 parent 946f0fa commit fd2c18e

File tree

123 files changed

+327
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+327
-478
lines changed
 

‎python/core/processing/qgsprocessingcontext.sip‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,12 @@ class QgsProcessingContext
7575
Sets the expression ``context``.
7676
%End
7777

78-
79-
78+
QgsProject &temporaryLayerStore();
79+
%Docstring
80+
Returns a reference to the project used for storing temporary layers during
81+
algorithm execution.
82+
:rtype: QgsProject
83+
%End
8084

8185
QgsFeatureRequest::InvalidGeometryCheck invalidGeometryCheck() const;
8286
%Docstring

‎python/plugins/processing/algs/qgis/AddTableField.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def processAlgorithm(self, context, feedback):
9797
fields = layer.fields()
9898
fields.append(QgsField(fieldName, self.TYPES[fieldType], '',
9999
fieldLength, fieldPrecision))
100-
writer = output.getVectorWriter(fields, layer.wkbType(),
101-
layer.crs())
100+
writer = output.getVectorWriter(fields, layer.wkbType(), layer.crs(), context)
102101
outFeat = QgsFeature()
103102
features = QgsProcessingUtils.getFeatures(layer, context)
104103
total = 100.0 / QgsProcessingUtils.featureCount(layer, context)

0 commit comments

Comments
 (0)
Please sign in to comment.