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

};

@@ -54,6 +54,9 @@ class ExampleAlgorithm(GeoAlgorithm):
OUTPUT_LAYER = 'OUTPUT_LAYER'
INPUT_LAYER = 'INPUT_LAYER'

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

def defineCharacteristics(self):
"""Here we define the inputs and output of the algorithm, along
with some other properties.
@@ -62,9 +65,6 @@ def defineCharacteristics(self):
# The name that the user will see in the toolbox
self.name, self.i18n_name = self.trAlgorithm('Create copy of layer')

# The branch of the toolbox under which the algorithm will appear
self.group, self.i18n_group = self.trAlgorithm('Algorithms for vector layers')

# We add the input vector layer. It can have any kind of geometry
# It is a mandatory (not optional) one, hence the False argument
self.addParameter(ParameterVector(self.INPUT_LAYER,
@@ -49,9 +49,11 @@ class AssignProjection(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-add.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Assign projection')
self.group, self.i18n_group = self.trAlgorithm('Raster projections')

self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterCrs(self.CRS,
@@ -56,9 +56,11 @@ class ClipByExtent(GdalAlgorithm):
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):
self.name, self.i18n_name = self.trAlgorithm('Clip raster by extent')
self.group, self.i18n_group = self.trAlgorithm('Raster extraction')

self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterString(self.NO_DATA,
@@ -65,9 +65,11 @@ class ClipByMask(GdalAlgorithm):
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):
self.name, self.i18n_name = self.trAlgorithm('Clip raster by mask layer')
self.group, self.i18n_group = self.trAlgorithm('Raster extraction')

self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
@@ -47,13 +47,11 @@ class ColorRelief(GdalAlgorithm):

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

#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Color relief')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -62,9 +62,11 @@ def icon(self):
def commandLineName(self):
return "gdal:gridaverage"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Moving average)')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -67,9 +67,11 @@ def icon(self):
def commandLineName(self):
return "gdal:griddatametrics"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Data metrics)')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -66,9 +66,11 @@ def icon(self):
def commandLineName(self):
return "gdal:gridinvdist"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Inverse distance to a power)')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -62,9 +62,11 @@ def icon(self):
def commandLineName(self):
return "gdal:gridnearestneighbor"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Nearest neighbor)')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -48,9 +48,11 @@ class aspect(GdalAlgorithm):
ZERO_FLAT = 'ZERO_FLAT'
OUTPUT = 'OUTPUT'

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Aspect')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -54,9 +54,11 @@ class buildvrt(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'vrt.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterSelection(self.RESOLUTION,
@@ -54,9 +54,11 @@ class contour(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'contour.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Contour')
self.group, self.i18n_group = self.trAlgorithm('Raster extraction')
self.addParameter(ParameterRaster(self.INPUT_RASTER,
self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.INTERVAL,
@@ -47,9 +47,11 @@ class ExtractProjection(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-export.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Extract projection')
self.group, self.i18n_group = self.trAlgorithm('Raster projections')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input file')))
self.addParameter(ParameterBoolean(self.PRJ_FILE,
self.tr('Create also .prj file'), False))
@@ -52,9 +52,11 @@ class fillnodata(GdalAlgorithm):
NO_DEFAULT_MASK = 'NO_DEFAULT_MASK'
OUTPUT = 'OUTPUT'

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Fill nodata')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.DISTANCE,
@@ -63,9 +63,11 @@ class gdal2tiles(GdalAlgorithm):
def commandLineName(self):
return "gdal:gdal2tiles"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('gdal2tiles')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')

# Required parameters
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
@@ -43,9 +43,11 @@ class gdal2xyz(GdalAlgorithm):
BAND = 'BAND'
OUTPUT = 'OUTPUT'

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('gdal2xyz')
self.group, self.i18n_group = self.trAlgorithm('Raster conversion')
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.BAND,
@@ -69,9 +69,11 @@ def icon(self):
def commandLineName(self):
return "gdal:overviews"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Build overviews (pyramids)')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterString(self.LEVELS,
@@ -59,9 +59,11 @@ class gdalcalc(GdalAlgorithm):
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
#DEBUG = 'DEBUG'

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Raster calculator')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
self.addParameter(ParameterRaster(
self.INPUT_A, self.tr('Input layer A'), False))
self.addParameter(ParameterString(self.BAND_A,
@@ -51,9 +51,11 @@ class gdaltindex(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'tiles.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Tile Index')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterString(self.FIELD_NAME,
@@ -51,9 +51,11 @@ class hillshade(GdalAlgorithm):
ALTITUDE = 'ALTITUDE'
OUTPUT = 'OUTPUT'

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Hillshade')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(self.BAND,
self.tr('Band number'), 1, 99, 1))
@@ -52,9 +52,11 @@ def icon(self):
def commandLineName(self):
return "gdal:gdalinfo"

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Information')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
self.addParameter(ParameterRaster(information.INPUT,
self.tr('Input layer'), False))
self.addParameter(ParameterBoolean(information.NOGCP,
@@ -57,9 +57,11 @@ class merge(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'merge.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Merge')
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'),
dataobjects.TYPE_RASTER))
@@ -50,9 +50,11 @@ class nearblack(GdalAlgorithm):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'nearblack.png'))

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Near black')
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
self.addParameter(ParameterRaster(self.INPUT,
self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.NEAR,
@@ -46,9 +46,11 @@ class OffsetCurve(GdalAlgorithm):
RADIUS = 'RADIUS'
OPTIONS = 'OPTIONS'

def group(self):
return self.tr('Vector geoprocessing')

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Offset lines for lines')
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')

self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE], False))
@@ -100,9 +100,11 @@ class Ogr2Ogr(GdalAlgorithm):
FORMAT = 'FORMAT'
OPTIONS = 'OPTIONS'

def group(self):
return self.tr('Vector conversion')

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Convert format')
self.group, self.i18n_group = self.trAlgorithm('Vector conversion')

self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer')))
@@ -51,9 +51,11 @@ class Ogr2OgrBuffer(GdalAlgorithm):
MULTI = 'MULTI'
OPTIONS = 'OPTIONS'

def group(self):
return self.tr('Vector geoprocessing')

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Buffer vectors')
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')

self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer')))
@@ -45,9 +45,11 @@ class Ogr2OgrClip(GdalAlgorithm):
CLIP_LAYER = 'CLIP_LAYER'
OPTIONS = 'OPTIONS'

def group(self):
return self.tr('Vector geoprocessing')

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Clip vectors by polygon')
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')

self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer')))