Class: ProcessingAlgFactory

class qgis.processing.ProcessingAlgFactory

Bases: object

Methods

help

Define the help for the algorithm using @alg.help.

input

Define a input parameter for this algorithm using @alg.input.

output

Define a output parameter for this algorithm using @alg.output.

tr

Returns a translatable string with the self.tr() function.

Attributes

AUTH_CFG

BAND

BOOL

COLOR

COORDINATE_OPERATION

CRS

DATABASE_SCHEMA

DATABASE_TABLE

DATETIME

DISTANCE

ENUM

EXPRESSION

EXTENT

FIELD

FILE

FILE_DEST

FOLDER

FOLDER_DEST

GEOMETRY

HTML

INT

LAYERDEF

LAYOUT

LAYOUT_ITEM

MAPLAYER

MAP_THEME

MATRIX

MESH_LAYER

MULTILAYER

NUMBER

POINT

PROVIDER_CONNECTION

RANGE

RASTER_LAYER

RASTER_LAYER_DEST

SCALE

SINK

SOURCE

STRING

VECTOR_LAYER

VECTOR_LAYER_DEST

AUTH_CFG = 'AUTH_CFG'
BAND = ('BAND',)
BOOL = ('BOOL',)
COLOR = 'COLOR'
COORDINATE_OPERATION = 'COORDINATE_OPERATION'
CRS = ('CRS',)
DATABASE_SCHEMA = 'DATABASE_SCHEMA'
DATABASE_TABLE = 'DATABASE_TABLE'
DATETIME = 'DATETIME'
DISTANCE = ('DISTANCE',)
ENUM = ('ENUM',)
EXPRESSION = ('EXPRESSION',)
EXTENT = ('EXTENT',)
FIELD = ('FIELD',)
FILE = ('FILE',)
FILE_DEST = ('FILE_DEST',)
FOLDER = ('FOLDER',)
FOLDER_DEST = ('FOLDER_DEST',)
GEOMETRY = ('GEOMETRY',)
HTML = ('HTML',)
INT = ('INT',)
LAYERDEF = ('LAYERDEF',)
LAYOUT = 'LAYOUT'
LAYOUT_ITEM = 'LAYOUT_ITEM'
MAPLAYER = ('MAPLAYER',)
MAP_THEME = 'MAP_THEME'
MATRIX = ('MATRIX',)
MESH_LAYER = ('MESH_LAYER',)
MULTILAYER = ('MULTILAYER',)
NUMBER = ('NUMBER',)
POINT = ('POINT',)
PROVIDER_CONNECTION = 'PROVIDER_CONNECTION'
RANGE = ('RANGE',)
RASTER_LAYER = ('RASTER_LAYER',)
RASTER_LAYER_DEST = ('RASTER_LAYER_DEST',)
SCALE = 'SCALE'
SINK = 'SINK'
SOURCE = 'SOURCE'
STRING = ('STRING',)
VECTOR_LAYER = ('VECTOR_LAYER',)
VECTOR_LAYER_DEST = ('VECTOR_LAYER_DEST',)
__init__()

Initialize self. See help(type(self)) for accurate signature.

property current
property current_defined
help(helpstring, *args, **kwargs)

Define the help for the algorithm using @alg.help. This method will be used instead of the doc string on the function as the help in the processing dialogs.

Parameters

helpstring – The help text. Use alg.tr() for translation support.

input(type, *args, **kwargs)

Define a input parameter for this algorithm using @alg.input. Apart from type this method will take all arguments and pass them though to the correct QgsProcessingParameterDefinition type.

Types:

str: QgsProcessingParameterString int: QgsProcessingParameterNumber float: QgsProcessingParameterNumber bool: QgsProcessingParameterBoolean alg.NUMBER: QgsProcessingParameterNumber alg.INT: QgsProcessingParameterNumber alg.STRING: QgsProcessingParameterString alg.DISTANCE: QgsProcessingParameterDistance alg.SINK: QgsProcessingParameterFeatureSink alg.SOURCE: QgsProcessingParameterFeatureSource alg.FILE_DEST: QgsProcessingParameterFileDestination alg.FOLDER_DEST: QgsProcessingParameterFolderDestination alg.RASTER_LAYER: QgsProcessingParameterRasterLayer alg.RASTER_LAYER_DEST: QgsProcessingParameterRasterDestination alg.VECTOR_LAYER_DEST: QgsProcessingParameterVectorDestination alg.BAND: QgsProcessingParameterBand alg.BOOL: QgsProcessingParameterBoolean alg.CRS: QgsProcessingParameterCrs alg.ENUM: QgsProcessingParameterEnum alg.EXPRESSION: QgsProcessingParameterExpression alg.EXTENT: QgsProcessingParameterExtent alg.FIELD: QgsProcessingParameterField alg.FILE: QgsProcessingParameterFile alg.MAPLAYER: QgsProcessingParameterMapLayer alg.MATRIX: QgsProcessingParameterMatrix alg.MULTILAYER: QgsProcessingParameterMultipleLayers alg.POINT: QgsProcessingParameterPoint alg.GEOMETRY: QgsProcessingParameterGeometry alg.RANGE: QgsProcessingParameterRange alg.VECTOR_LAYER: QgsProcessingParameterVectorLayer alg.AUTH_CFG: QgsProcessingParameterAuthConfig alg.MESH_LAYER: QgsProcessingParameterMeshLayer alg.SCALE: QgsProcessingParameterScale alg.LAYOUT: QgsProcessingParameterLayout alg.LAYOUT_ITEM: QgsProcessingParameterLayoutItem alg.COLOR: QgsProcessingParameterColor alg.DATETIME: QgsProcessingParameterDateTime alg.MAP_THEME: QgsProcessingParameterMapTheme alg.PROVIDER_CONNECTION: QgsProcessingParameterProviderConnection alg.DATABASE_SCHEMA: QgsProcessingParameterDatabaseSchema alg.DATABASE_TABLE: QgsProcessingParameterDatabaseTable alg.COORDINATE_OPERATION: QgsProcessingParameterCoordinateOperation

Parameters
  • type – The type of the input. This should be a type define on alg like alg.STRING, alg.DISTANCE

  • label – The label of the output. Translates into description arg.

  • parent – The string ID of the parent parameter. Parent parameter must be defined before its here.

  • default – The default value set for that parameter. Translates into defaultValue arg.

output(type, *args, **kwargs)

Define a output parameter for this algorithm using @alg.output. Apart from type this method will take all arguments and pass them though to the correct :py:class:.QgsProcessingOutputDefinition` ` type.

Types:

str: QgsProcessingOutputString int: QgsProcessingOutputNumber float: QgsProcessingOutputNumber alg.NUMBER: QgsProcessingOutputNumber alg.DISTANCE: QgsProcessingOutputNumber alg.INT: QgsProcessingOutputNumber alg.STRING: QgsProcessingOutputString alg.FILE: QgsProcessingOutputFile alg.FOLDER: QgsProcessingOutputFolder alg.HTML: QgsProcessingOutputHtml alg.LAYERDEF: QgsProcessingOutputLayerDefinition alg.MAPLAYER: QgsProcessingOutputMapLayer alg.MULTILAYER: QgsProcessingOutputMultipleLayers alg.RASTER_LAYER: QgsProcessingOutputRasterLayer alg.VECTOR_LAYER: QgsProcessingOutputVectorLayer alg.BOOL: QgsProcessingOutputBoolean

Parameters
  • type – The type of the input. This should be a type define on alg like alg.STRING, alg.DISTANCE

  • label – The label of the output. Will convert into description arg.

  • parent – The string ID of the parent parameter. Parent parameter must be defined before its here.

tr(string)

Returns a translatable string with the self.tr() function.