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

QgsProcessingAlgorithm();
virtual ~QgsProcessingAlgorithm();

virtual QString name() const = 0;
virtual QString displayName() const = 0;
virtual QStringList tags() const;
virtual QIcon icon() const;
virtual QString svgIconPath() const;
@@ -54,6 +54,14 @@ 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')

@@ -62,9 +70,6 @@ def defineCharacteristics(self):
with some other properties.
"""

# The name that the user will see in the toolbox
self.name, self.i18n_name = self.trAlgorithm('Create copy of layer')

# 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,
@@ -46,15 +46,19 @@ class AssignProjection(GdalAlgorithm):
CRS = 'CRS'
OUTPUT = 'OUTPUT'

def name(self):
return 'Assign projection'

def displayName(self):
return self.tr('Assign projection')

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.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterCrs(self.CRS,
self.tr('Desired CRS'), ''))
@@ -53,15 +53,19 @@ class ClipByExtent(GdalAlgorithm):
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def name(self):
return 'Clip raster by extent'

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):
self.name, self.i18n_name = self.trAlgorithm('Clip raster by extent')

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"),
@@ -62,15 +62,19 @@ class ClipByMask(GdalAlgorithm):
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def name(self):
return 'Clip raster by mask layer'

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):
self.name, self.i18n_name = self.trAlgorithm('Clip raster by mask layer')

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

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

def name(self):
return 'Color relief'

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

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Color relief')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -56,6 +56,12 @@ class GridAverage(GdalAlgorithm):

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

def name(self):
return 'Grid (Moving average)'

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

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

@@ -66,7 +72,6 @@ def group(self):
return self.tr('Raster analysis')

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Moving average)')
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -61,6 +61,12 @@ class GridDataMetrics(GdalAlgorithm):
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
'Average distance between points']

def name(self):
return 'Grid (Data metrics)'

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

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

@@ -71,7 +77,6 @@ def group(self):
return self.tr('Raster analysis')

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

def name(self):
return 'Grid (Inverse distance to a power)'

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

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.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -62,11 +62,16 @@ def icon(self):
def commandLineName(self):
return "gdal:gridnearestneighbor"

def name(self):
return 'Grid (Nearest neighbor)'

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

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Nearest neighbor)')
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
@@ -48,11 +48,16 @@ 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):
self.name, self.i18n_name = self.trAlgorithm('Aspect')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
@@ -51,14 +51,19 @@ class buildvrt(GdalAlgorithm):

RESOLUTION_OPTIONS = ['average', 'highest', 'lowest']

def name(self):
return 'Build Virtual Raster'

def displayName(self):
return self.tr('Build Virtual Raster')

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.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterSelection(self.RESOLUTION,
@@ -51,14 +51,19 @@ class contour(GdalAlgorithm):
FIELD_NAME = 'FIELD_NAME'
EXTRA = 'EXTRA'

def name(self):
return 'Contour'

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

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.addParameter(ParameterRaster(self.INPUT_RASTER,
self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.INTERVAL,
@@ -44,14 +44,19 @@ class ExtractProjection(GdalAlgorithm):
INPUT = 'INPUT'
PRJ_FILE = 'PRJ_FILE'

def name(self):
return 'Extract projection'

def displayName(self):
return self.tr('Extract projection')

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.addParameter(ParameterRaster(self.INPUT, self.tr('Input file')))
self.addParameter(ParameterBoolean(self.PRJ_FILE,
self.tr('Create also .prj file'), False))
@@ -52,11 +52,16 @@ class fillnodata(GdalAlgorithm):
NO_DEFAULT_MASK = 'NO_DEFAULT_MASK'
OUTPUT = 'OUTPUT'

def name(self):
return 'Fill nodata'

def displayName(self):
return self.tr('Fill nodata')

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

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

def name(self):
return 'gdal2tiles'

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

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('gdal2tiles')

# Required parameters
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))

@@ -43,11 +43,16 @@ class gdal2xyz(GdalAlgorithm):
BAND = 'BAND'
OUTPUT = 'OUTPUT'

def name(self):
return 'gdal2xyz'

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

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

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

def name(self):
return 'Build overviews (pyramids)'

def displayName(self):
return self.tr('Build overviews (pyramids)')

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

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

def name(self):
return 'Raster calculator'

def displayName(self):
return self.tr('Raster calculator')

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

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Raster calculator')
self.addParameter(ParameterRaster(
self.INPUT_A, self.tr('Input layer A'), False))
self.addParameter(ParameterString(self.BAND_A,
@@ -48,14 +48,19 @@ class gdaltindex(GdalAlgorithm):
FIELD_NAME = 'FIELD_NAME'
PROJ_DIFFERENCE = 'PROJ_DIFFERENCE'

def name(self):
return 'Tile Index'

def displayName(self):
return self.tr('Tile Index')

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.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterString(self.FIELD_NAME,
Loading

0 comments on commit 6987d7b

Please sign in to comment.