Skip to content
Permalink
Browse files

Move alg character definitions to __init__

  • Loading branch information
nyalldawson committed Jun 5, 2017
1 parent 134c04b commit 77ab9337880dc27b752ce1b419a1c1a0b283dbdb
Showing with 1,772 additions and 1,577 deletions.
  1. +13 −12 python/plugins/processing/algs/exampleprovider/ExampleAlgorithm.py
  2. +8 −7 python/plugins/processing/algs/gdal/AssignProjection.py
  3. +14 −13 python/plugins/processing/algs/gdal/ClipByExtent.py
  4. +14 −13 python/plugins/processing/algs/gdal/ClipByMask.py
  5. +11 −10 python/plugins/processing/algs/gdal/ColorRelief.py
  6. +14 −13 python/plugins/processing/algs/gdal/GridAverage.py
  7. +14 −13 python/plugins/processing/algs/gdal/GridDataMetrics.py
  8. +11 −10 python/plugins/processing/algs/gdal/GridInvDist.py
  9. +11 −10 python/plugins/processing/algs/gdal/GridNearest.py
  10. +11 −10 python/plugins/processing/algs/gdal/aspect.py
  11. +12 −11 python/plugins/processing/algs/gdal/buildvrt.py
  12. +14 −13 python/plugins/processing/algs/gdal/contour.py
  13. +6 −5 python/plugins/processing/algs/gdal/extractprojection.py
  14. +11 −10 python/plugins/processing/algs/gdal/fillnodata.py
  15. +11 −10 python/plugins/processing/algs/gdal/gdal2tiles.py
  16. +9 −8 python/plugins/processing/algs/gdal/gdal2xyz.py
  17. +11 −10 python/plugins/processing/algs/gdal/gdaladdo.py
  18. +11 −10 python/plugins/processing/algs/gdal/gdalcalc.py
  19. +11 −10 python/plugins/processing/algs/gdal/gdaltindex.py
  20. +11 −10 python/plugins/processing/algs/gdal/hillshade.py
  21. +11 −10 python/plugins/processing/algs/gdal/information.py
  22. +11 −10 python/plugins/processing/algs/gdal/merge.py
  23. +11 −10 python/plugins/processing/algs/gdal/nearblack.py
  24. +11 −10 python/plugins/processing/algs/gdal/offsetcurve.py
  25. +11 −10 python/plugins/processing/algs/gdal/ogr2ogr.py
  26. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrbuffer.py
  27. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrclip.py
  28. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrclipextent.py
  29. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrdissolve.py
  30. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py
  31. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py
  32. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
  33. +11 −10 python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
  34. +9 −8 python/plugins/processing/algs/gdal/ogrinfo.py
  35. +11 −10 python/plugins/processing/algs/gdal/ogrsql.py
  36. +11 −10 python/plugins/processing/algs/gdal/onesidebuffer.py
  37. +11 −10 python/plugins/processing/algs/gdal/pct2rgb.py
  38. +8 −7 python/plugins/processing/algs/gdal/polygonize.py
  39. +11 −10 python/plugins/processing/algs/gdal/proximity.py
  40. +11 −10 python/plugins/processing/algs/gdal/rasterize.py
  41. +8 −7 python/plugins/processing/algs/gdal/rasterize_over.py
  42. +11 −10 python/plugins/processing/algs/gdal/retile.py
  43. +8 −7 python/plugins/processing/algs/gdal/rgb2pct.py
  44. +8 −7 python/plugins/processing/algs/gdal/roughness.py
  45. +10 −9 python/plugins/processing/algs/gdal/sieve.py
  46. +8 −7 python/plugins/processing/algs/gdal/slope.py
  47. +8 −7 python/plugins/processing/algs/gdal/tpi.py
  48. +11 −10 python/plugins/processing/algs/gdal/translate.py
  49. +10 −9 python/plugins/processing/algs/gdal/tri.py
  50. +11 −10 python/plugins/processing/algs/gdal/warp.py
  51. +11 −10 python/plugins/processing/algs/grass7/nviz7.py
  52. +8 −8 python/plugins/processing/algs/qgis/AddTableField.py
  53. +8 −7 python/plugins/processing/algs/qgis/Aspect.py
  54. +6 −5 python/plugins/processing/algs/qgis/AutoincrementalField.py
  55. +8 −7 python/plugins/processing/algs/qgis/BarPlot.py
  56. +8 −7 python/plugins/processing/algs/qgis/BasicStatistics.py
  57. +8 −7 python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
  58. +8 −7 python/plugins/processing/algs/qgis/BasicStatisticsStrings.py
  59. +7 −6 python/plugins/processing/algs/qgis/Boundary.py
  60. +6 −5 python/plugins/processing/algs/qgis/BoundingBox.py
  61. +8 −7 python/plugins/processing/algs/qgis/BoxPlot.py
  62. +7 −6 python/plugins/processing/algs/qgis/Centroids.py
  63. +8 −7 python/plugins/processing/algs/qgis/CheckValidity.py
  64. +8 −7 python/plugins/processing/algs/qgis/Clip.py
  65. +8 −7 python/plugins/processing/algs/qgis/ConcaveHull.py
  66. +8 −7 python/plugins/processing/algs/qgis/ConvexHull.py
  67. +8 −7 python/plugins/processing/algs/qgis/CreateAttributeIndex.py
  68. +8 −7 python/plugins/processing/algs/qgis/CreateConstantRaster.py
  69. +8 −7 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  70. +8 −7 python/plugins/processing/algs/qgis/DefineProjection.py
  71. +8 −7 python/plugins/processing/algs/qgis/Delaunay.py
  72. +8 −7 python/plugins/processing/algs/qgis/DeleteColumn.py
  73. +6 −5 python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
  74. +8 −7 python/plugins/processing/algs/qgis/DeleteHoles.py
  75. +8 −7 python/plugins/processing/algs/qgis/DensifyGeometries.py
  76. +8 −7 python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
  77. +8 −7 python/plugins/processing/algs/qgis/Difference.py
  78. +8 −7 python/plugins/processing/algs/qgis/Dissolve.py
  79. +8 −7 python/plugins/processing/algs/qgis/DropGeometry.py
  80. +8 −7 python/plugins/processing/algs/qgis/EliminateSelection.py
  81. +8 −7 python/plugins/processing/algs/qgis/EquivalentNumField.py
  82. +8 −7 python/plugins/processing/algs/qgis/ExecuteSQL.py
  83. +7 −6 python/plugins/processing/algs/qgis/Explode.py
  84. +8 −7 python/plugins/processing/algs/qgis/ExportGeometryInfo.py
  85. +8 −7 python/plugins/processing/algs/qgis/ExtendLines.py
  86. +8 −7 python/plugins/processing/algs/qgis/ExtentFromLayer.py
  87. +8 −7 python/plugins/processing/algs/qgis/ExtractByAttribute.py
  88. +8 −7 python/plugins/processing/algs/qgis/ExtractByExpression.py
  89. +8 −7 python/plugins/processing/algs/qgis/ExtractByLocation.py
  90. +8 −7 python/plugins/processing/algs/qgis/ExtractNodes.py
  91. +8 −7 python/plugins/processing/algs/qgis/ExtractSpecificNodes.py
  92. +8 −7 python/plugins/processing/algs/qgis/FieldPyculator.py
  93. +8 −7 python/plugins/processing/algs/qgis/FieldsCalculator.py
  94. +8 −7 python/plugins/processing/algs/qgis/FieldsMapper.py
  95. +8 −7 python/plugins/processing/algs/qgis/FindProjection.py
  96. +8 −7 python/plugins/processing/algs/qgis/FixGeometry.py
  97. +8 −7 python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
  98. +8 −7 python/plugins/processing/algs/qgis/GeometryByExpression.py
  99. +8 −7 python/plugins/processing/algs/qgis/GeometryConvert.py
  100. +8 −7 python/plugins/processing/algs/qgis/GridLine.py
  101. +8 −7 python/plugins/processing/algs/qgis/GridPolygon.py
  102. +8 −7 python/plugins/processing/algs/qgis/Gridify.py
  103. +8 −7 python/plugins/processing/algs/qgis/Heatmap.py
  104. +8 −7 python/plugins/processing/algs/qgis/Hillshade.py
  105. +8 −7 python/plugins/processing/algs/qgis/HubDistanceLines.py
  106. +8 −7 python/plugins/processing/algs/qgis/HubDistancePoints.py
  107. +8 −7 python/plugins/processing/algs/qgis/HubLines.py
  108. +8 −7 python/plugins/processing/algs/qgis/HypsometricCurves.py
  109. +8 −6 python/plugins/processing/algs/qgis/IdwInterpolation.py
  110. +8 −7 python/plugins/processing/algs/qgis/ImportIntoPostGIS.py
  111. +8 −7 python/plugins/processing/algs/qgis/ImportIntoSpatialite.py
  112. +8 −7 python/plugins/processing/algs/qgis/Intersection.py
  113. +8 −7 python/plugins/processing/algs/qgis/JoinAttributes.py
  114. +8 −7 python/plugins/processing/algs/qgis/LinesIntersection.py
  115. +7 −6 python/plugins/processing/algs/qgis/LinesToPolygons.py
  116. +8 −7 python/plugins/processing/algs/qgis/MeanAndStdDevPlot.py
  117. +8 −7 python/plugins/processing/algs/qgis/MeanCoords.py
  118. +8 −7 python/plugins/processing/algs/qgis/Merge.py
  119. +6 −5 python/plugins/processing/algs/qgis/MergeLines.py
  120. +5 −4 python/plugins/processing/algs/qgis/MultipartToSingleparts.py
  121. +8 −7 python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py
  122. +8 −7 python/plugins/processing/algs/qgis/OffsetLine.py
  123. +8 −7 python/plugins/processing/algs/qgis/OrientedMinimumBoundingBox.py
  124. +8 −7 python/plugins/processing/algs/qgis/Orthogonalize.py
  125. +8 −7 python/plugins/processing/algs/qgis/PointDistance.py
  126. +6 −5 python/plugins/processing/algs/qgis/PointOnSurface.py
  127. +8 −7 python/plugins/processing/algs/qgis/PointsAlongGeometry.py
  128. +8 −7 python/plugins/processing/algs/qgis/PointsDisplacement.py
  129. +8 −7 python/plugins/processing/algs/qgis/PointsFromLines.py
  130. +8 −7 python/plugins/processing/algs/qgis/PointsFromPolygons.py
  131. +8 −7 python/plugins/processing/algs/qgis/PointsInPolygon.py
  132. +8 −7 python/plugins/processing/algs/qgis/PointsInPolygonUnique.py
  133. +8 −7 python/plugins/processing/algs/qgis/PointsInPolygonWeighted.py
  134. +8 −7 python/plugins/processing/algs/qgis/PointsLayerFromTable.py
  135. +8 −7 python/plugins/processing/algs/qgis/PointsToPaths.py
  136. +8 −7 python/plugins/processing/algs/qgis/PolarPlot.py
  137. +8 −7 python/plugins/processing/algs/qgis/PoleOfInaccessibility.py
  138. +7 −6 python/plugins/processing/algs/qgis/PolygonCentroids.py
  139. +8 −7 python/plugins/processing/algs/qgis/Polygonize.py
  140. +7 −6 python/plugins/processing/algs/qgis/PolygonsToLines.py
  141. +8 −7 python/plugins/processing/algs/qgis/PostGISExecuteSQL.py
  142. +8 −7 python/plugins/processing/algs/qgis/RandomExtract.py
  143. +8 −7 python/plugins/processing/algs/qgis/RandomExtractWithinSubsets.py
  144. +8 −7 python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
  145. +8 −7 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  146. +8 −7 python/plugins/processing/algs/qgis/RandomPointsLayer.py
  147. +8 −7 python/plugins/processing/algs/qgis/RandomPointsPolygonsFixed.py
  148. +8 −7 python/plugins/processing/algs/qgis/RandomPointsPolygonsVariable.py
  149. +8 −7 python/plugins/processing/algs/qgis/RandomSelection.py
  150. +8 −7 python/plugins/processing/algs/qgis/RandomSelectionWithinSubsets.py
  151. +8 −7 python/plugins/processing/algs/qgis/RasterCalculator.py
  152. +8 −7 python/plugins/processing/algs/qgis/RasterLayerHistogram.py
  153. +8 −7 python/plugins/processing/algs/qgis/RasterLayerStatistics.py
  154. +8 −7 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsFixed.py
  155. +8 −7 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
  156. +8 −7 python/plugins/processing/algs/qgis/RegularPoints.py
  157. +8 −6 python/plugins/processing/algs/qgis/Relief.py
  158. +6 −5 python/plugins/processing/algs/qgis/RemoveNullGeometry.py
  159. +8 −7 python/plugins/processing/algs/qgis/ReprojectLayer.py
  160. +6 −5 python/plugins/processing/algs/qgis/ReverseLineDirection.py
  161. +8 −7 python/plugins/processing/algs/qgis/Ruggedness.py
  162. +8 −7 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
  163. +8 −7 python/plugins/processing/algs/qgis/SelectByAttribute.py
  164. +8 −7 python/plugins/processing/algs/qgis/SelectByAttributeSum.py
  165. +8 −7 python/plugins/processing/algs/qgis/SelectByExpression.py
  166. +8 −7 python/plugins/processing/algs/qgis/SelectByLocation.py
  167. +8 −7 python/plugins/processing/algs/qgis/ServiceAreaFromLayer.py
  168. +8 −7 python/plugins/processing/algs/qgis/ServiceAreaFromPoint.py
  169. +8 −7 python/plugins/processing/algs/qgis/SetRasterStyle.py
  170. +8 −7 python/plugins/processing/algs/qgis/SetVectorStyle.py
  171. +8 −7 python/plugins/processing/algs/qgis/ShortestPathLayerToPoint.py
  172. +8 −7 python/plugins/processing/algs/qgis/ShortestPathPointToLayer.py
  173. +8 −7 python/plugins/processing/algs/qgis/ShortestPathPointToPoint.py
  174. +8 −7 python/plugins/processing/algs/qgis/SimplifyGeometries.py
  175. +8 −7 python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py
  176. +8 −7 python/plugins/processing/algs/qgis/SingleSidedBuffer.py
  177. +8 −7 python/plugins/processing/algs/qgis/Slope.py
  178. +8 −7 python/plugins/processing/algs/qgis/Smooth.py
  179. +8 −7 python/plugins/processing/algs/qgis/SnapGeometries.py
  180. +7 −6 python/plugins/processing/algs/qgis/SpatialIndex.py
  181. +8 −7 python/plugins/processing/algs/qgis/SpatialJoin.py
  182. +5 −4 python/plugins/processing/algs/qgis/SpatialiteExecuteSQL.py
  183. +8 −7 python/plugins/processing/algs/qgis/SplitLinesWithLines.py
  184. +8 −7 python/plugins/processing/algs/qgis/SplitWithLines.py
  185. +8 −7 python/plugins/processing/algs/qgis/StatisticsByCategories.py
  186. +8 −7 python/plugins/processing/algs/qgis/SumLines.py
  187. +8 −7 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  188. +8 −7 python/plugins/processing/algs/qgis/TextToFloat.py
  189. +8 −7 python/plugins/processing/algs/qgis/TinInterpolation.py
  190. +8 −7 python/plugins/processing/algs/qgis/TopoColors.py
  191. +8 −7 python/plugins/processing/algs/qgis/Translate.py
  192. +7 −6 python/plugins/processing/algs/qgis/TruncateTable.py
  193. +8 −7 python/plugins/processing/algs/qgis/Union.py
  194. +8 −7 python/plugins/processing/algs/qgis/UniqueValues.py
  195. +8 −7 python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
  196. +8 −7 python/plugins/processing/algs/qgis/VectorGridLines.py
  197. +8 −7 python/plugins/processing/algs/qgis/VectorGridPolygons.py
  198. +8 −7 python/plugins/processing/algs/qgis/VectorLayerHistogram.py
  199. +8 −7 python/plugins/processing/algs/qgis/VectorLayerScatterplot.py
  200. +8 −7 python/plugins/processing/algs/qgis/VectorLayerScatterplot3D.py
  201. +8 −7 python/plugins/processing/algs/qgis/VectorSplit.py
  202. +8 −7 python/plugins/processing/algs/qgis/VoronoiPolygons.py
  203. +8 −7 python/plugins/processing/algs/qgis/ZonalStatistics.py
  204. +8 −7 python/plugins/processing/algs/qgis/ZonalStatisticsQgis.py
  205. +11 −10 python/plugins/processing/algs/saga/SplitRGBBands.py
  206. +0 −7 python/plugins/processing/core/GeoAlgorithm.py
  207. +15 −16 python/plugins/processing/modeler/ModelerAlgorithm.py
  208. +3 −6 python/plugins/processing/preconfigured/PreconfiguredAlgorithm.py
@@ -54,18 +54,8 @@ class ExampleAlgorithm(GeoAlgorithm):
OUTPUT_LAYER = 'OUTPUT_LAYER'
INPUT_LAYER = 'INPUT_LAYER'

def name(self):
# Unique (non-user visible) name of algorithm
return 'create_copy_of_layer'

def displayName(self):
# The name that the user will see in the toolbox
return self.tr('Create copy of layer')

def group(self):
return self.tr('Algorithms for vector layers')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
"""Here we define the inputs and output of the algorithm, along
with some other properties.
"""
@@ -79,6 +69,17 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT_LAYER,
self.tr('Output layer with selected features')))

def name(self):
# Unique (non-user visible) name of algorithm
return 'create_copy_of_layer'

def displayName(self):
# The name that the user will see in the toolbox
return self.tr('Create copy of layer')

def group(self):
return self.tr('Algorithms for vector layers')

def processAlgorithm(self, context, feedback):
"""Here is where the processing itself takes place.
:param context:
@@ -46,6 +46,14 @@ class AssignProjection(GdalAlgorithm):
CRS = 'CRS'
OUTPUT = 'OUTPUT'

def __init__(self):
super().__init__()
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterCrs(self.CRS,
self.tr('Desired CRS'), ''))

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Layer with projection'), True))

def name(self):
return 'assignprojection'

@@ -58,13 +66,6 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def defineCharacteristics(self):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterCrs(self.CRS,
self.tr('Desired CRS'), ''))

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Layer with projection'), True))

def getConsoleCommands(self):
fileName = self.getParameterValue(self.INPUT)
crs = self.getParameterValue(self.CRS)
@@ -53,19 +53,8 @@ class ClipByExtent(GdalAlgorithm):
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def name(self):
return 'cliprasterbyextent'

def displayName(self):
return self.tr('Clip raster by extent')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def group(self):
return self.tr('Raster extraction')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
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"),
@@ -82,6 +71,18 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Clipped (extent)')))

def name(self):
return 'cliprasterbyextent'

def displayName(self):
return self.tr('Clip raster by extent')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self):
out = self.getOutputValue(self.OUTPUT)
noData = self.getParameterValue(self.NO_DATA)
@@ -63,19 +63,8 @@ class ClipByMask(GdalAlgorithm):
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def name(self):
return 'cliprasterbymasklayer'

def displayName(self):
return self.tr('Clip raster by mask layer')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def group(self):
return self.tr('Raster extraction')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
[dataobjects.TYPE_VECTOR_POLYGON]))
@@ -101,6 +90,18 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Clipped (mask)')))

def name(self):
return 'cliprasterbymasklayer'

def displayName(self):
return self.tr('Clip raster by mask layer')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self):
out = self.getOutputValue(self.OUTPUT)
mask = self.getParameterValue(self.MASK)
@@ -47,16 +47,8 @@ class ColorRelief(GdalAlgorithm):

MATCHING_MODES = ['"0,0,0,0" RGBA', 'Exact color', 'Nearest color']

def name(self):
return 'colorrelief'

def displayName(self):
return self.tr('Color relief')

def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -69,6 +61,15 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Color relief')))

def name(self):
return 'colorrelief'

def displayName(self):
return self.tr('Color relief')

def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self):
arguments = ['color-relief']
arguments.append(str(self.getParameterValue(self.INPUT)))
@@ -56,19 +56,8 @@ class GridAverage(GdalAlgorithm):

TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def name(self):
return 'gridaverage'

def displayName(self):
return self.tr('Grid (Moving average)')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -89,6 +78,18 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Interpolated moving average')))

def name(self):
return 'gridaverage'

def displayName(self):
return self.tr('Grid (Moving average)')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self):
arguments = ['-l']
arguments.append(
@@ -61,19 +61,8 @@ class GridDataMetrics(GdalAlgorithm):
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
'Average distance between points']

def name(self):
return 'griddatametrics'

def displayName(self):
return self.tr('Grid (Data metrics)')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -96,6 +85,18 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Interpolated metrics')))

def name(self):
return 'griddatametrics'

def displayName(self):
return self.tr('Grid (Data metrics)')

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self):
arguments = ['-l']
arguments.append(
@@ -63,16 +63,8 @@ class GridInvDist(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def name(self):
return 'gridinvdist'

def displayName(self):
return self.tr('Grid (Inverse distance to a power)')

def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -99,6 +91,15 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Interpolated IDW')))

def name(self):
return 'gridinvdist'

def displayName(self):
return self.tr('Grid (Inverse distance to a power)')

def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self):
arguments = ['-l']
arguments.append(
@@ -59,16 +59,8 @@ class GridNearest(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def name(self):
return 'gridnearestneighbor'

def displayName(self):
return self.tr('Grid (Nearest neighbor)')

def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -87,6 +79,15 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Interpolated nearest neighbor')))

def name(self):
return 'gridnearestneighbor'

def displayName(self):
return self.tr('Grid (Nearest neighbor)')

def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self):
arguments = ['-l']
arguments.append(
@@ -48,16 +48,8 @@ class aspect(GdalAlgorithm):
ZERO_FLAT = 'ZERO_FLAT'
OUTPUT = 'OUTPUT'

def name(self):
return 'aspect'

def displayName(self):
return self.tr('Aspect')

def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
def __init__(self):
super().__init__()
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -73,6 +65,15 @@ def defineCharacteristics(self):

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Aspect')))

def name(self):
return 'aspect'

def displayName(self):
return self.tr('Aspect')

def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self):
arguments = ['aspect']
arguments.append(str(self.getParameterValue(self.INPUT)))

0 comments on commit 77ab933

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