Skip to content

Commit

Permalink
Merge pull request #5867 from alexbruy/processing-group
Browse files Browse the repository at this point in the history
[processing] add groupId() method to get untranslated algorithm group
  • Loading branch information
nyalldawson committed Dec 15, 2017
2 parents abdd875 + 2674022 commit db07bc6
Show file tree
Hide file tree
Showing 268 changed files with 841 additions and 6 deletions.
Expand Up @@ -22,7 +22,7 @@ class QgsProcessingModelAlgorithm : QgsProcessingAlgorithm
%End
public:

QgsProcessingModelAlgorithm( const QString &name = QString(), const QString &group = QString() );
QgsProcessingModelAlgorithm( const QString &name = QString(), const QString &group = QString(), const QString &groupId = QString() );
%Docstring
Constructor for QgsProcessingModelAlgorithm.
%End
Expand All @@ -36,6 +36,8 @@ class QgsProcessingModelAlgorithm : QgsProcessingAlgorithm

virtual QString group() const;

virtual QString groupId() const;

virtual QIcon icon() const;

virtual QString svgIconPath() const;
Expand Down
10 changes: 10 additions & 0 deletions python/core/processing/qgsprocessingalgorithm.sip
Expand Up @@ -158,10 +158,20 @@ class QgsProcessingAlgorithm
%Docstring
Returns the name of the group this algorithm belongs to. This string
should be localised.
.. seealso:: :py:func:`groupId()`
.. seealso:: :py:func:`tags()`
:rtype: str
%End

virtual QString groupId() const;
%Docstring
Returns the unique ID of the group this algorithm belongs to. This string
should be fixed for the algorithm, and must not be localised. The group id
should be unique within each provider. Group id should contain lowercase
alphanumeric characters only and no spaces or other formatting characters.
.. seealso:: :py:func:`group()`
:rtype: str
%End
virtual Flags flags() const;
%Docstring
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/AssignProjection.py
Expand Up @@ -70,6 +70,9 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def group(self):
return 'rasterprojections'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)
fileName = inLayer.source()
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/Buffer.py
Expand Up @@ -95,6 +95,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipRasterByExtent.py
Expand Up @@ -99,6 +99,9 @@ def displayName(self):
def group(self):
return self.tr('Raster extraction')

def groupId(self):
return 'rasterextraction'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipRasterByMask.py
Expand Up @@ -116,6 +116,9 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def groupId(self):
return 'rasterextraction'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipVectorByExtent.py
Expand Up @@ -71,6 +71,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipVectorByMask.py
Expand Up @@ -70,6 +70,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ColorRelief.py
Expand Up @@ -92,6 +92,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = ['color-relief']
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/Dissolve.py
Expand Up @@ -106,6 +106,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ExecuteSql.py
Expand Up @@ -82,6 +82,9 @@ def displayName(self):
def group(self):
return self.tr('Vector miscellaneous')

def groupId(self):
return 'vectormiscellaneous'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
ogrLayer, layerName = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing)
sql = self.parameterAsString(parameters, self.SQL, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/GridAverage.py
Expand Up @@ -132,6 +132,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/GridDataMetrics.py
Expand Up @@ -149,6 +149,9 @@ def icon(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
ogrLayer, layerName = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing)

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/GridInverseDistance.py
Expand Up @@ -152,6 +152,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

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

Expand Down
Expand Up @@ -139,6 +139,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/GridLinear.py
Expand Up @@ -114,6 +114,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/GridNearestNeighbor.py
Expand Up @@ -127,6 +127,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/OffsetCurve.py
Expand Up @@ -78,6 +78,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/OgrToPostGis.py
Expand Up @@ -162,6 +162,9 @@ def displayName(self):
def group(self):
return self.tr('Vector miscellaneous')

def groupId(self):
return 'vectormiscellaneous'

def getConnectionString(self, parameters, context):
host = self.parameterAsString(parameters, self.HOST, context)
port = self.parameterAsString(parameters, self.PORT, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/OneSideBuffer.py
Expand Up @@ -104,6 +104,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/PointsAlongLines.py
Expand Up @@ -83,6 +83,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/aspect.py
Expand Up @@ -93,6 +93,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = ['aspect']
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/buildvrt.py
Expand Up @@ -100,6 +100,9 @@ def icon(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = []
arguments.append('-resolution')
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/contour.py
Expand Up @@ -118,6 +118,9 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def groupId(self):
return 'rasterextraction'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)
fieldName = self.parameterAsString(parameters, self.FIELD_NAME, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/extractprojection.py
Expand Up @@ -63,6 +63,9 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def groupId(self):
return 'rasterprojections'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/fillnodata.py
Expand Up @@ -86,6 +86,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = []
arguments.append('-md')
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/gdal2tiles.py
Expand Up @@ -153,6 +153,9 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = []

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/gdal2xyz.py
Expand Up @@ -69,6 +69,9 @@ def displayName(self):
def group(self):
return self.tr('Raster conversion')

def groupId(self):
return 'rasterconversion'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = []
arguments = []
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/gdaladdo.py
Expand Up @@ -99,6 +99,9 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/gdalcalc.py
Expand Up @@ -102,6 +102,9 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
out = self.getOutputValue(self.OUTPUT)
extra = self.getParameterValue(self.EXTRA)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/gdalinfo.py
Expand Up @@ -80,6 +80,9 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/gdaltindex.py
Expand Up @@ -111,6 +111,9 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/hillshade.py
Expand Up @@ -120,6 +120,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments = ['hillshade']
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/merge.py
Expand Up @@ -98,6 +98,9 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def groupId(self):
return 'rastermiscellaneous'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/nearblack.py
Expand Up @@ -86,6 +86,9 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def groupId(self):
return 'rasteranalysis'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogr.py
Expand Up @@ -68,6 +68,9 @@ def displayName(self):
def group(self):
return self.tr('Vector conversion')

def groupId(self):
return 'vectorconversion'

def commandName(self):
return 'ogr2ogr'

Expand Down
Expand Up @@ -119,6 +119,9 @@ def displayName(self):
def group(self):
return self.tr('Vector miscellaneous')

def groupId(self):
return 'vectormiscellaneous'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
connection = self.DB_CONNECTIONS[self.getParameterValue(self.DATABASE)]
uri = uri_from_name(connection)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
Expand Up @@ -176,6 +176,9 @@ def displayName(self):
def group(self):
return self.tr('Vector miscellaneous')

def groupId(self):
return 'vectormiscellaneous'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
connection = self.parameterAsString(parameters, self.DATABASE, context)
uri = uri_from_name(connection)
Expand Down

0 comments on commit db07bc6

Please sign in to comment.