Class: QgsProcessingParameterFeatureSink

A feature sink output for processing algorithms.

A parameter which represents the destination feature sink for features created by an algorithm.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterFeatureSink

Base classes

QgsProcessingDestinationParameter

Base class for all parameter definitions which represent file or layer destinations, e.g. parameters which are used for the destination for layers output by an algorithm.

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

QgsFileFilterGenerator

Abstract interface for classes which generate a file filter string.

Methods

dataType

Returns the layer type for sinks associated with the parameter.

hasGeometry

Returns True if sink is likely to include geometries.

setDataType

Sets the layer type for the sinks associated with the parameter.

setSupportsAppend

Sets whether the sink supports appending features to an existing table.

supportsAppend

Returns True if the sink supports appending features to an existing table.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsProcessingParameterFeatureSink. See the FAQ for more details.

supportedOutputVectorLayerExtensions

Returns a list of the vector format file extensions supported by this parameter.

Static Methods

fromScriptCode

Creates a new parameter using the definition from a script code.

typeName

Returns the type name for the parameter class.

class qgis.core.QgsProcessingParameterFeatureSink[source]

Bases: QgsProcessingDestinationParameter

__init__(name: str | None, description: str | None = '', type: Qgis.ProcessingSourceType = Qgis.ProcessingSourceType.VectorAnyGeometry, defaultValue: Any = None, optional: bool = False, createByDefault: bool = True, supportsAppend: bool = False)

Constructor for QgsProcessingParameterFeatureSink.

If createByDefault is False and the parameter is optional, then this destination output will not be created by default.

Parameters:
  • name (Optional[str])

  • description (Optional[str] = '')

  • type (Qgis.ProcessingSourceType = Qgis.ProcessingSourceType.VectorAnyGeometry)

  • defaultValue (Any = None)

  • optional (bool = False)

  • createByDefault (bool = True)

  • supportsAppend (bool = False)

__init__(a0: QgsProcessingParameterFeatureSink)
Parameters:

a0 (QgsProcessingParameterFeatureSink)

dataType(self) Qgis.ProcessingSourceType[source]

Returns the layer type for sinks associated with the parameter.

See also

setDataType()

Return type:

Qgis.ProcessingSourceType

static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterFeatureSink | None[source]

Creates a new parameter using the definition from a script code.

Parameters:
  • name (Optional[str])

  • description (Optional[str])

  • isOptional (bool)

  • definition (Optional[str])

Return type:

Optional[QgsProcessingParameterFeatureSink]

hasGeometry(self) bool[source]

Returns True if sink is likely to include geometries. In cases were presence of geometry cannot be reliably determined in advance, this method will default to returning True.

Return type:

bool

setDataType(self, type: Qgis.ProcessingSourceType)[source]

Sets the layer type for the sinks associated with the parameter.

See also

dataType()

Parameters:

type (Qgis.ProcessingSourceType)

setSupportsAppend(self, supportsAppend: bool)[source]

Sets whether the sink supports appending features to an existing table.

Warning

A sink only supports appending if the algorithm implements QgsProcessingAlgorithm.sinkProperties for the sink parameter.

See also

supportsAppend()

Added in version 3.14.

Parameters:

supportsAppend (bool)

virtual supportedOutputVectorLayerExtensions(self) List[str][source]

Returns a list of the vector format file extensions supported by this parameter.

See also

defaultFileExtension()

Added in version 3.2.

Return type:

List[str]

supportsAppend(self) bool[source]

Returns True if the sink supports appending features to an existing table.

A sink only supports appending if the algorithm implements QgsProcessingAlgorithm.sinkProperties for the sink parameter.

Added in version 3.14.

Return type:

bool

static typeName() str[source]

Returns the type name for the parameter class.

Return type:

str