Skip to content
Permalink
Browse files

Fix overridden function signatures

  • Loading branch information
nyalldawson committed Aug 13, 2017
1 parent 5c888c5 commit ce8e18da104af944688c2b5c87b1d701fc30daf7
Showing with 145 additions and 49 deletions.
  1. +3 −1 python/plugins/processing/algs/gdal/AssignProjection.py
  2. +3 −1 python/plugins/processing/algs/gdal/ClipByExtent.py
  3. +3 −1 python/plugins/processing/algs/gdal/ClipByMask.py
  4. +3 −1 python/plugins/processing/algs/gdal/ColorRelief.py
  5. +1 −1 python/plugins/processing/algs/gdal/GdalAlgorithm.py
  6. +3 −1 python/plugins/processing/algs/gdal/GridAverage.py
  7. +3 −1 python/plugins/processing/algs/gdal/GridDataMetrics.py
  8. +3 −1 python/plugins/processing/algs/gdal/GridInvDist.py
  9. +3 −1 python/plugins/processing/algs/gdal/GridNearest.py
  10. +3 −1 python/plugins/processing/algs/gdal/aspect.py
  11. +3 −1 python/plugins/processing/algs/gdal/buildvrt.py
  12. +3 −1 python/plugins/processing/algs/gdal/contour.py
  13. +3 −1 python/plugins/processing/algs/gdal/extractprojection.py
  14. +3 −1 python/plugins/processing/algs/gdal/fillnodata.py
  15. +3 −1 python/plugins/processing/algs/gdal/gdal2tiles.py
  16. +3 −1 python/plugins/processing/algs/gdal/gdal2xyz.py
  17. +3 −1 python/plugins/processing/algs/gdal/gdaladdo.py
  18. +3 −1 python/plugins/processing/algs/gdal/gdalcalc.py
  19. +3 −1 python/plugins/processing/algs/gdal/gdaltindex.py
  20. +3 −1 python/plugins/processing/algs/gdal/hillshade.py
  21. +3 −1 python/plugins/processing/algs/gdal/information.py
  22. +3 −1 python/plugins/processing/algs/gdal/merge.py
  23. +3 −1 python/plugins/processing/algs/gdal/nearblack.py
  24. +3 −1 python/plugins/processing/algs/gdal/offsetcurve.py
  25. +3 −1 python/plugins/processing/algs/gdal/ogr2ogr.py
  26. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrbuffer.py
  27. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrclip.py
  28. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrclipextent.py
  29. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrdissolve.py
  30. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py
  31. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py
  32. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
  33. +3 −1 python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
  34. +3 −1 python/plugins/processing/algs/gdal/ogrinfo.py
  35. +3 −1 python/plugins/processing/algs/gdal/ogrsql.py
  36. +3 −1 python/plugins/processing/algs/gdal/onesidebuffer.py
  37. +3 −1 python/plugins/processing/algs/gdal/pct2rgb.py
  38. +3 −1 python/plugins/processing/algs/gdal/polygonize.py
  39. +3 −1 python/plugins/processing/algs/gdal/proximity.py
  40. +3 −1 python/plugins/processing/algs/gdal/rasterize.py
  41. +3 −1 python/plugins/processing/algs/gdal/rasterize_over.py
  42. +3 −1 python/plugins/processing/algs/gdal/retile.py
  43. +3 −1 python/plugins/processing/algs/gdal/rgb2pct.py
  44. +3 −1 python/plugins/processing/algs/gdal/roughness.py
  45. +3 −1 python/plugins/processing/algs/gdal/sieve.py
  46. +3 −1 python/plugins/processing/algs/gdal/slope.py
  47. +3 −1 python/plugins/processing/algs/gdal/tpi.py
  48. +3 −1 python/plugins/processing/algs/gdal/translate.py
  49. +3 −1 python/plugins/processing/algs/gdal/tri.py
@@ -48,6 +48,8 @@ class AssignProjection(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterCrs(self.CRS,
self.tr('Desired CRS'), ''))
@@ -66,7 +68,7 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
fileName = self.getParameterValue(self.INPUT)
crs = self.getParameterValue(self.CRS)
output = self.getOutputValue(self.OUTPUT) # NOQA
@@ -55,6 +55,8 @@ class ClipByExtent(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterString(self.NO_DATA,
self.tr("Nodata value, leave blank to take the nodata value from input"),
@@ -83,7 +85,7 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
out = self.getOutputValue(self.OUTPUT)
noData = self.getParameterValue(self.NO_DATA)
opts = self.getParameterValue(self.OPTIONS)
@@ -65,6 +65,8 @@ class ClipByMask(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
[dataobjects.TYPE_VECTOR_POLYGON]))
@@ -102,7 +104,7 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
out = self.getOutputValue(self.OUTPUT)
mask = self.getParameterValue(self.MASK)
context = dataobjects.createContext()
@@ -49,6 +49,8 @@ class ColorRelief(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -70,7 +72,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['color-relief']
arguments.append(str(self.getParameterValue(self.INPUT)))
arguments.append(str(self.getParameterValue(self.COLOR_TABLE)))
@@ -62,7 +62,7 @@ def createInstance(self, config={}):
def createCustomParametersWidget(self, parent):
return GdalAlgorithmDialog(self)

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
return None

def processAlgorithm(self, parameters, context, feedback):
@@ -58,6 +58,8 @@ class GridAverage(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -90,7 +92,7 @@ def icon(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
@@ -63,6 +63,8 @@ class GridDataMetrics(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -97,7 +99,7 @@ def icon(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
@@ -65,6 +65,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -100,7 +102,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
@@ -61,6 +61,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -88,7 +90,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
@@ -50,6 +50,8 @@ class aspect(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -74,7 +76,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['aspect']
arguments.append(str(self.getParameterValue(self.INPUT)))
output = str(self.getOutputValue(self.OUTPUT))
@@ -53,6 +53,8 @@ class buildvrt(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterSelection(self.RESOLUTION,
@@ -75,7 +77,7 @@ def icon(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
arguments.append('-resolution')
arguments.append(self.RESOLUTION_OPTIONS[self.getParameterValue(self.RESOLUTION)])
@@ -53,6 +53,8 @@ class contour(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT_RASTER,
self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.INTERVAL,
@@ -79,7 +81,7 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
output = self.getOutputValue(self.OUTPUT_VECTOR)
interval = str(self.getParameterValue(self.INTERVAL))
fieldName = str(self.getParameterValue(self.FIELD_NAME))
@@ -46,6 +46,8 @@ class ExtractProjection(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input file')))
self.addParameter(ParameterBoolean(self.PRJ_FILE,
self.tr('Create also .prj file'), False))
@@ -62,7 +64,7 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
return ["extractprojection"]

def processAlgorithm(self, parameters, context, feedback):
@@ -54,6 +54,8 @@ class fillnodata(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.DISTANCE,
@@ -78,7 +80,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
output = self.getOutputValue(self.OUTPUT)

arguments = []
@@ -64,6 +64,8 @@ class gdal2tiles(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
# Required parameters
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))

@@ -128,7 +130,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):

arguments = []

@@ -45,6 +45,8 @@ class gdal2xyz(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.BAND,
@@ -61,7 +63,7 @@ def displayName(self):
def group(self):
return self.tr('Raster conversion')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
arguments.append('-band')
arguments.append(str(self.getParameterValue(self.BAND)))
@@ -68,6 +68,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterString(self.LEVELS,
@@ -89,7 +91,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
inFile = self.getParameterValue(self.INPUT)
clearOverviews = self.getParameterValue(self.CLEAN)
ovrFormat = self.getParameterValue(self.FORMAT)
@@ -61,6 +61,8 @@ class gdalcalc(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT_A, self.tr('Input layer A'), False))
self.addParameter(ParameterString(self.BAND_A,
@@ -106,7 +108,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
out = self.getOutputValue(self.OUTPUT)
extra = self.getParameterValue(self.EXTRA)
if extra is not None:
@@ -50,6 +50,8 @@ class gdaltindex(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterString(self.FIELD_NAME,
@@ -71,7 +73,7 @@ def icon(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
fieldName = str(self.getParameterValue(self.FIELD_NAME))

arguments = []
@@ -53,6 +53,8 @@ class hillshade(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(self.BAND,
self.tr('Band number'), 1, 99, 1))
@@ -83,7 +85,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['hillshade']
arguments.append(str(self.getParameterValue(self.INPUT)))
arguments.append(str(self.getOutputValue(self.OUTPUT)))
@@ -51,6 +51,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(information.INPUT,
self.tr('Input layer'), False))
self.addParameter(ParameterBoolean(information.NOGCP,
@@ -69,7 +71,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
if self.getParameterValue(information.NOGCP):
arguments.append('-nogcp')
@@ -59,6 +59,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'),
dataobjects.TYPE_RASTER))
@@ -87,7 +89,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])

0 comments on commit ce8e18d

Please sign in to comment.
You can’t perform that action at this time.