Skip to content
Permalink
Browse files
[processing] Pass context argument to processAlgorithm
  • Loading branch information
nyalldawson committed Apr 26, 2017
1 parent 241d283 commit dd4f530cfb10614529afb37926e7eb5804a84a00
Showing with 208 additions and 188 deletions.
  1. +4 −2 python/plugins/processing/algs/exampleprovider/ExampleAlgorithm.py
  2. +1 −1 python/plugins/processing/algs/gdal/GdalAlgorithm.py
  3. +1 −1 python/plugins/processing/algs/gdal/extractprojection.py
  4. +1 −1 python/plugins/processing/algs/gdal/information.py
  5. +2 −2 python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py
  6. +2 −2 python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
  7. +1 −1 python/plugins/processing/algs/gdal/ogrinfo.py
  8. +1 −1 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  9. +1 −1 python/plugins/processing/algs/grass7/nviz7.py
  10. +1 −1 python/plugins/processing/algs/qgis/AddTableField.py
  11. +1 −1 python/plugins/processing/algs/qgis/Aspect.py
  12. +1 −1 python/plugins/processing/algs/qgis/AutoincrementalField.py
  13. +1 −1 python/plugins/processing/algs/qgis/BarPlot.py
  14. +1 −1 python/plugins/processing/algs/qgis/BasicStatistics.py
  15. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
  16. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsStrings.py
  17. +1 −1 python/plugins/processing/algs/qgis/Boundary.py
  18. +1 −1 python/plugins/processing/algs/qgis/BoundingBox.py
  19. +1 −1 python/plugins/processing/algs/qgis/BoxPlot.py
  20. +1 −1 python/plugins/processing/algs/qgis/Centroids.py
  21. +1 −1 python/plugins/processing/algs/qgis/CheckValidity.py
  22. +1 −1 python/plugins/processing/algs/qgis/Clip.py
  23. +1 −1 python/plugins/processing/algs/qgis/ConcaveHull.py
  24. +1 −1 python/plugins/processing/algs/qgis/ConvexHull.py
  25. +1 −1 python/plugins/processing/algs/qgis/CreateAttributeIndex.py
  26. +1 −1 python/plugins/processing/algs/qgis/CreateConstantRaster.py
  27. +1 −1 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  28. +1 −1 python/plugins/processing/algs/qgis/DefineProjection.py
  29. +1 −1 python/plugins/processing/algs/qgis/Delaunay.py
  30. +1 −1 python/plugins/processing/algs/qgis/DeleteColumn.py
  31. +1 −1 python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
  32. +1 −1 python/plugins/processing/algs/qgis/DeleteHoles.py
  33. +1 −1 python/plugins/processing/algs/qgis/DensifyGeometries.py
  34. +1 −1 python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
  35. +1 −1 python/plugins/processing/algs/qgis/Difference.py
  36. +1 −1 python/plugins/processing/algs/qgis/Dissolve.py
  37. +1 −1 python/plugins/processing/algs/qgis/DropGeometry.py
  38. +1 −1 python/plugins/processing/algs/qgis/EliminateSelection.py
  39. +1 −1 python/plugins/processing/algs/qgis/EquivalentNumField.py
  40. +1 −1 python/plugins/processing/algs/qgis/ExecuteSQL.py
  41. +1 −1 python/plugins/processing/algs/qgis/Explode.py
  42. +1 −1 python/plugins/processing/algs/qgis/ExportGeometryInfo.py
  43. +1 −1 python/plugins/processing/algs/qgis/ExtendLines.py
  44. +1 −1 python/plugins/processing/algs/qgis/ExtentFromLayer.py
  45. +1 −1 python/plugins/processing/algs/qgis/ExtractByAttribute.py
  46. +1 −1 python/plugins/processing/algs/qgis/ExtractByExpression.py
  47. +1 −1 python/plugins/processing/algs/qgis/ExtractByLocation.py
  48. +1 −1 python/plugins/processing/algs/qgis/ExtractNodes.py
  49. +1 −1 python/plugins/processing/algs/qgis/ExtractSpecificNodes.py
  50. +1 −1 python/plugins/processing/algs/qgis/FieldPyculator.py
  51. +1 −1 python/plugins/processing/algs/qgis/FieldsCalculator.py
  52. +1 −1 python/plugins/processing/algs/qgis/FieldsMapper.py
  53. +1 −1 python/plugins/processing/algs/qgis/FindProjection.py
  54. +1 −1 python/plugins/processing/algs/qgis/FixGeometry.py
  55. +1 −1 python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
  56. +1 −1 python/plugins/processing/algs/qgis/GeometryByExpression.py
  57. +1 −1 python/plugins/processing/algs/qgis/GeometryConvert.py
  58. +1 −1 python/plugins/processing/algs/qgis/GridLine.py
  59. +1 −1 python/plugins/processing/algs/qgis/GridPolygon.py
  60. +1 −1 python/plugins/processing/algs/qgis/Gridify.py
  61. +1 −1 python/plugins/processing/algs/qgis/Heatmap.py
  62. +1 −1 python/plugins/processing/algs/qgis/Hillshade.py
  63. +1 −1 python/plugins/processing/algs/qgis/HubDistanceLines.py
  64. +1 −1 python/plugins/processing/algs/qgis/HubDistancePoints.py
  65. +1 −1 python/plugins/processing/algs/qgis/HubLines.py
  66. +1 −1 python/plugins/processing/algs/qgis/HypsometricCurves.py
  67. +1 −1 python/plugins/processing/algs/qgis/IdwInterpolation.py
  68. +1 −1 python/plugins/processing/algs/qgis/ImportIntoPostGIS.py
  69. +1 −1 python/plugins/processing/algs/qgis/ImportIntoSpatialite.py
  70. +1 −1 python/plugins/processing/algs/qgis/Intersection.py
  71. +1 −1 python/plugins/processing/algs/qgis/JoinAttributes.py
  72. +1 −1 python/plugins/processing/algs/qgis/LinesIntersection.py
  73. +1 −1 python/plugins/processing/algs/qgis/LinesToPolygons.py
  74. +1 −1 python/plugins/processing/algs/qgis/MeanAndStdDevPlot.py
  75. +1 −1 python/plugins/processing/algs/qgis/MeanCoords.py
  76. +1 −1 python/plugins/processing/algs/qgis/Merge.py
  77. +1 −1 python/plugins/processing/algs/qgis/MergeLines.py
  78. +1 −1 python/plugins/processing/algs/qgis/MultipartToSingleparts.py
  79. +1 −1 python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py
  80. +1 −1 python/plugins/processing/algs/qgis/OffsetLine.py
  81. +1 −1 python/plugins/processing/algs/qgis/OrientedMinimumBoundingBox.py
  82. +1 −1 python/plugins/processing/algs/qgis/Orthogonalize.py
  83. +1 −1 python/plugins/processing/algs/qgis/PointDistance.py
  84. +1 −1 python/plugins/processing/algs/qgis/PointOnSurface.py
  85. +1 −1 python/plugins/processing/algs/qgis/PointsAlongGeometry.py
  86. +1 −1 python/plugins/processing/algs/qgis/PointsDisplacement.py
  87. +1 −1 python/plugins/processing/algs/qgis/PointsFromLines.py
  88. +1 −1 python/plugins/processing/algs/qgis/PointsFromPolygons.py
  89. +1 −1 python/plugins/processing/algs/qgis/PointsInPolygon.py
  90. +1 −1 python/plugins/processing/algs/qgis/PointsInPolygonUnique.py
  91. +1 −1 python/plugins/processing/algs/qgis/PointsInPolygonWeighted.py
  92. +1 −1 python/plugins/processing/algs/qgis/PointsLayerFromTable.py
  93. +1 −1 python/plugins/processing/algs/qgis/PointsToPaths.py
  94. +1 −1 python/plugins/processing/algs/qgis/PolarPlot.py
  95. +1 −1 python/plugins/processing/algs/qgis/PoleOfInaccessibility.py
  96. +1 −1 python/plugins/processing/algs/qgis/PolygonCentroids.py
  97. +1 −1 python/plugins/processing/algs/qgis/Polygonize.py
  98. +1 −1 python/plugins/processing/algs/qgis/PolygonsToLines.py
  99. +1 −1 python/plugins/processing/algs/qgis/PostGISExecuteSQL.py
  100. +1 −1 python/plugins/processing/algs/qgis/RandomExtract.py
  101. +1 −1 python/plugins/processing/algs/qgis/RandomExtractWithinSubsets.py
  102. +1 −1 python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
  103. +1 −1 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  104. +1 −1 python/plugins/processing/algs/qgis/RandomPointsLayer.py
  105. +1 −1 python/plugins/processing/algs/qgis/RandomPointsPolygonsFixed.py
  106. +1 −1 python/plugins/processing/algs/qgis/RandomPointsPolygonsVariable.py
  107. +1 −1 python/plugins/processing/algs/qgis/RandomSelection.py
  108. +1 −1 python/plugins/processing/algs/qgis/RandomSelectionWithinSubsets.py
  109. +1 −1 python/plugins/processing/algs/qgis/RasterCalculator.py
  110. +1 −1 python/plugins/processing/algs/qgis/RasterLayerHistogram.py
  111. +1 −1 python/plugins/processing/algs/qgis/RasterLayerStatistics.py
  112. +1 −1 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsFixed.py
  113. +1 −1 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
  114. +1 −1 python/plugins/processing/algs/qgis/RegularPoints.py
  115. +1 −1 python/plugins/processing/algs/qgis/Relief.py
  116. +1 −1 python/plugins/processing/algs/qgis/RemoveNullGeometry.py
  117. +1 −1 python/plugins/processing/algs/qgis/ReprojectLayer.py
  118. +1 −1 python/plugins/processing/algs/qgis/ReverseLineDirection.py
  119. +1 −1 python/plugins/processing/algs/qgis/Ruggedness.py
  120. +1 −1 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
  121. +1 −1 python/plugins/processing/algs/qgis/SelectByAttribute.py
  122. +1 −1 python/plugins/processing/algs/qgis/SelectByAttributeSum.py
  123. +1 −1 python/plugins/processing/algs/qgis/SelectByExpression.py
  124. +1 −1 python/plugins/processing/algs/qgis/SelectByLocation.py
  125. +1 −1 python/plugins/processing/algs/qgis/ServiceAreaFromLayer.py
  126. +1 −1 python/plugins/processing/algs/qgis/ServiceAreaFromPoint.py
  127. +1 −1 python/plugins/processing/algs/qgis/SetRasterStyle.py
  128. +1 −1 python/plugins/processing/algs/qgis/SetVectorStyle.py
  129. +1 −1 python/plugins/processing/algs/qgis/ShortestPathLayerToPoint.py
  130. +1 −1 python/plugins/processing/algs/qgis/ShortestPathPointToLayer.py
  131. +1 −1 python/plugins/processing/algs/qgis/ShortestPathPointToPoint.py
  132. +1 −1 python/plugins/processing/algs/qgis/SimplifyGeometries.py
  133. +1 −1 python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py
  134. +1 −1 python/plugins/processing/algs/qgis/SingleSidedBuffer.py
  135. +1 −1 python/plugins/processing/algs/qgis/Slope.py
  136. +1 −1 python/plugins/processing/algs/qgis/Smooth.py
  137. +1 −1 python/plugins/processing/algs/qgis/SnapGeometries.py
  138. +1 −1 python/plugins/processing/algs/qgis/SpatialIndex.py
  139. +1 −1 python/plugins/processing/algs/qgis/SpatialJoin.py
  140. +1 −1 python/plugins/processing/algs/qgis/SpatialiteExecuteSQL.py
  141. +1 −1 python/plugins/processing/algs/qgis/SplitLinesWithLines.py
  142. +1 −1 python/plugins/processing/algs/qgis/SplitWithLines.py
  143. +1 −1 python/plugins/processing/algs/qgis/StatisticsByCategories.py
  144. +1 −1 python/plugins/processing/algs/qgis/SumLines.py
  145. +1 −1 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  146. +1 −1 python/plugins/processing/algs/qgis/TextToFloat.py
  147. +1 −1 python/plugins/processing/algs/qgis/TinInterpolation.py
  148. +1 −1 python/plugins/processing/algs/qgis/TopoColors.py
  149. +1 −1 python/plugins/processing/algs/qgis/Translate.py
  150. +1 −1 python/plugins/processing/algs/qgis/TruncateTable.py
  151. +1 −1 python/plugins/processing/algs/qgis/Union.py
  152. +1 −1 python/plugins/processing/algs/qgis/UniqueValues.py
  153. +1 −1 python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
  154. +1 −1 python/plugins/processing/algs/qgis/VectorGridLines.py
  155. +1 −1 python/plugins/processing/algs/qgis/VectorGridPolygons.py
  156. +1 −1 python/plugins/processing/algs/qgis/VectorLayerHistogram.py
  157. +1 −1 python/plugins/processing/algs/qgis/VectorLayerScatterplot.py
  158. +1 −1 python/plugins/processing/algs/qgis/VectorLayerScatterplot3D.py
  159. +1 −1 python/plugins/processing/algs/qgis/VectorSplit.py
  160. +1 −1 python/plugins/processing/algs/qgis/VoronoiPolygons.py
  161. +2 −1 python/plugins/processing/algs/qgis/ZonalStatistics.py
  162. +1 −1 python/plugins/processing/algs/qgis/ZonalStatisticsQgis.py
  163. +1 −1 python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py
  164. +1 −1 python/plugins/processing/algs/r/RAlgorithm.py
  165. +1 −1 python/plugins/processing/algs/saga/SagaAlgorithm.py
  166. +1 −1 python/plugins/processing/algs/saga/SplitRGBBands.py
  167. +7 −4 python/plugins/processing/core/GeoAlgorithm.py
  168. +3 −2 python/plugins/processing/core/Processing.py
  169. +1 −1 python/plugins/processing/gui/AlgorithmDialog.py
  170. +6 −4 python/plugins/processing/gui/AlgorithmExecutor.py
  171. +1 −1 python/plugins/processing/gui/BatchAlgorithmDialog.py
  172. +1 −1 python/plugins/processing/gui/ProcessingToolbox.py
  173. +1 −1 python/plugins/processing/gui/menus.py
  174. +2 −2 python/plugins/processing/modeler/ModelerAlgorithm.py
  175. +1 −1 python/plugins/processing/preconfigured/PreconfiguredAlgorithm.py
  176. +1 −1 python/plugins/processing/script/ScriptAlgorithm.py
  177. +12 −1 python/plugins/processing/tools/general.py
@@ -79,8 +79,10 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT_LAYER,
self.tr('Output layer with selected features')))

def processAlgorithm(self, feedback):
"""Here is where the processing itself takes place."""
def processAlgorithm(self, context, feedback):
"""Here is where the processing itself takes place.
:param context:
"""

# The first thing to do is retrieve the values of the parameters
# entered by the user
@@ -58,7 +58,7 @@ def svgIconPath(self):
def getCustomParametersDialog(self):
return GdalAlgorithmDialog(self)

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
commands = self.getConsoleCommands()
layers = QgsProcessingUtils.compatibleVectorLayers(QgsProject.instance())
supported = QgsVectorFileWriter.supportedFormatExtensions()
@@ -64,7 +64,7 @@ def defineCharacteristics(self):
def getConsoleCommands(self):
return ["extractprojection"]

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
rasterPath = self.getParameterValue(self.INPUT)
createPrj = self.getParameterValue(self.PRJ_FILE)

@@ -77,7 +77,7 @@ def getConsoleCommands(self):
arguments.append(self.getParameterValue(information.INPUT))
return ['gdalinfo', GdalUtils.escapeAndJoin(arguments)]

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
GdalUtils.runGdal(self.getConsoleCommands(), feedback)
output = self.getOutputValue(information.OUTPUT)
with open(output, 'w') as f:
@@ -125,9 +125,9 @@ def defineCharacteristics(self):
self.addParameter(ParameterString(self.OPTIONS,
self.tr('Additional creation options'), '', optional=True))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
self.processing = True
GdalAlgorithm.processAlgorithm(self, feedback)
GdalAlgorithm.processAlgorithm(self, context, feedback)
self.processing = False

def getConsoleCommands(self):
@@ -177,9 +177,9 @@ def defineCharacteristics(self):
self.addParameter(ParameterString(self.OPTIONS,
self.tr('Additional creation options'), '', optional=True))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
self.processing = True
GdalAlgorithm.processAlgorithm(self, feedback)
GdalAlgorithm.processAlgorithm(None, self)
self.processing = False

def getConsoleCommands(self):
@@ -70,7 +70,7 @@ def getConsoleCommands(self):
arguments.append(conn)
return arguments

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
GdalUtils.runGdal(self.getConsoleCommands(), feedback)
output = self.getOutputValue(self.OUTPUT)
with open(output, 'w') as f:
@@ -247,7 +247,7 @@ def getDefaultCellsize(self):
cellsize = 100
return cellsize

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
if system.isWindows():
path = Grass7Utils.grassPath()
if path == '':
@@ -92,7 +92,7 @@ def defineCharacteristics(self):
self.tr('GRASS region cellsize (leave 0 for default)'),
0, None, 0.0))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
commands = []
vector = self.getParameterValue(self.VECTOR)
elevation = self.getParameterValue(self.ELEVATION)
@@ -83,7 +83,7 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(
self.OUTPUT_LAYER, self.tr('Added')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
fieldType = self.getParameterValue(self.FIELD_TYPE)
fieldName = self.getParameterValue(self.FIELD_NAME)
fieldLength = self.getParameterValue(self.FIELD_LENGTH)
@@ -66,7 +66,7 @@ def defineCharacteristics(self):
self.addOutput(OutputRaster(self.OUTPUT_LAYER,
self.tr('Aspect')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
inputFile = self.getParameterValue(self.INPUT_LAYER)
zFactor = self.getParameterValue(self.Z_FACTOR)
outputFile = self.getOutputValue(self.OUTPUT_LAYER)
@@ -60,7 +60,7 @@ def defineCharacteristics(self):
self.tr('Input layer')))
self.addOutput(OutputVector(self.OUTPUT, self.tr('Incremented')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
output = self.getOutputFromName(self.OUTPUT)
vlayer = \
dataobjects.getLayerFromString(self.getParameterValue(self.INPUT))
@@ -73,7 +73,7 @@ def defineCharacteristics(self):

self.addOutput(OutputHTML(self.OUTPUT, self.tr('Bar plot')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))
namefieldname = self.getParameterValue(self.NAME_FIELD)
@@ -120,7 +120,7 @@ def defineCharacteristics(self):
self.addOutput(OutputNumber(self.THIRDQUARTILE, self.tr('Third quartile')))
self.addOutput(OutputNumber(self.IQR, self.tr('Interquartile Range (IQR)')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT_LAYER))
field_name = self.getParameterValue(self.FIELD_NAME)
@@ -114,7 +114,7 @@ def defineCharacteristics(self):
self.addOutput(OutputNumber(self.NULLVALUES, self.tr('NULL (missed) values')))
self.addOutput(OutputNumber(self.IQR, self.tr('Interquartile Range (IQR)')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT_LAYER))
fieldName = self.getParameterValue(self.FIELD_NAME)
@@ -100,7 +100,7 @@ def defineCharacteristics(self):
self.addOutput(OutputNumber(self.MIN_VALUE, self.tr('Minimum string value')))
self.addOutput(OutputNumber(self.MAX_VALUE, self.tr('Maximum string value')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT_LAYER))
fieldName = self.getParameterValue(self.FIELD_NAME)
@@ -63,7 +63,7 @@ def defineCharacteristics(self):
dataobjects.TYPE_VECTOR_POLYGON]))
self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Boundary')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT_LAYER))

@@ -62,7 +62,7 @@ def defineCharacteristics(self):
self.tr('Input layer')))
self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Bounds'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT_LAYER))

@@ -82,7 +82,7 @@ def defineCharacteristics(self):

self.addOutput(OutputHTML(self.OUTPUT, self.tr('Box plot')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))
namefieldname = self.getParameterValue(self.NAME_FIELD)
@@ -63,7 +63,7 @@ def defineCharacteristics(self):

self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Centroids'), datatype=[dataobjects.TYPE_VECTOR_POINT]))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT_LAYER))

@@ -87,7 +87,7 @@ def defineCharacteristics(self):
self.ERROR_OUTPUT,
self.tr('Error output')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
settings = QgsSettings()
initial_method_setting = settings.value(settings_method_key, 1)

@@ -65,7 +65,7 @@ def defineCharacteristics(self):
self.tr('Clip layer'), [dataobjects.TYPE_VECTOR_POLYGON]))
self.addOutput(OutputVector(Clip.OUTPUT, self.tr('Clipped')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
source_layer = dataobjects.getLayerFromString(
self.getParameterValue(Clip.INPUT))
mask_layer = dataobjects.getLayerFromString(
@@ -78,7 +78,7 @@ def defineCharacteristics(self):
self.addOutput(
OutputVector(ConcaveHull.OUTPUT, self.tr('Concave hull'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(self.getParameterValue(ConcaveHull.INPUT))
alpha = self.getParameterValue(self.ALPHA)
holes = self.getParameterValue(self.HOLES)
@@ -76,7 +76,7 @@ def defineCharacteristics(self):
self.tr('Method'), self.methods))
self.addOutput(OutputVector(self.OUTPUT, self.tr('Convex hull'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))
useField = self.getParameterValue(self.METHOD) == 1
@@ -66,7 +66,7 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT,
self.tr('Indexed layer'), True))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
file_name = self.getParameterValue(self.INPUT)
layer = dataobjects.getLayerFromString(file_name)
field = self.getParameterValue(self.FIELD)
@@ -67,7 +67,7 @@ def defineCharacteristics(self):
self.addOutput(OutputRaster(self.OUTPUT,
self.tr('Constant')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))
value = self.getParameterValue(self.NUMBER)
@@ -76,7 +76,7 @@ def defineCharacteristics(self):
self.addOutput(OutputString(self.VRT_STRING,
self.tr('Virtual string')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
input_layers = self.getParameterValue(self.DATASOURCES)
unioned = self.getParameterValue(self.UNIONED)
vrtPath = self.getOutputValue(self.VRT_FILE)
@@ -73,7 +73,7 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT,
self.tr('Layer with projection'), True))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
fileName = self.getParameterValue(self.INPUT)
layer = dataobjects.getLayerFromString(fileName)
crs = QgsCoordinateReferenceSystem(self.getParameterValue(self.CRS))
@@ -69,7 +69,7 @@ def defineCharacteristics(self):
self.tr('Delaunay triangulation'),
datatype=[dataobjects.TYPE_VECTOR_POLYGON]))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))

@@ -64,7 +64,7 @@ def defineCharacteristics(self):
self.tr('Fields to delete'), self.INPUT, multiple=True))
self.addOutput(OutputVector(self.OUTPUT, self.tr('Output layer')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(self.getParameterValue(self.INPUT))

fields_to_delete = self.getParameterValue(self.COLUMNS).split(';')
@@ -58,7 +58,7 @@ def defineCharacteristics(self):
self.tr('Input layer')))
self.addOutput(OutputVector(self.OUTPUT, self.tr('Cleaned')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))

@@ -64,7 +64,7 @@ def defineCharacteristics(self):

self.addOutput(OutputVector(self.OUTPUT, self.tr('Cleaned'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))
min_area = self.getParameterValue(self.MIN_AREA)
@@ -76,7 +76,7 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT,
self.tr('Densified')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(
self.getParameterValue(self.INPUT))
vertices = self.getParameterValue(self.VERTICES)
@@ -71,7 +71,7 @@ def defineCharacteristics(self):

self.addOutput(OutputVector(self.OUTPUT, self.tr('Densified')))

def processAlgorithm(self, feedback):
def processAlgorithm(self, context, feedback):
layer = dataobjects.getLayerFromString(self.getParameterValue(self.INPUT))
interval = self.getParameterValue(self.INTERVAL)