Class: QgsProcessingParameterVectorDestination

class qgis.core.QgsProcessingParameterVectorDestination

Bases: QgsProcessingDestinationParameter

A vector layer destination parameter, for specifying the destination path for a vector layer created by the algorithm.

Note

Consider using the more flexible QgsProcessingParameterFeatureSink wherever possible.

New in version 3.0.

QgsProcessingParameterVectorDestination(name: str, description: str = ‘’, type: QgsProcessing.SourceType = QgsProcessing.TypeVectorAnyGeometry, defaultValue: Any = None, optional: bool = False, createByDefault: bool = True) Constructor for QgsProcessingParameterVectorDestination.

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

QgsProcessingParameterVectorDestination(QgsProcessingParameterVectorDestination)

Methods

asPythonString

param outputType

asScriptCode

rtype

str

checkValueIsAcceptable

param input

clone

rtype

QgsProcessingParameterDefinition

createFileFilter

rtype

str

dataType

Returns the layer type for this created vector layer.

defaultFileExtension

rtype

str

fromScriptCode

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

fromVariantMap

param map

hasGeometry

Returns True if the created layer is likely to include geometries.

originalProvider

Original (source) provider which this parameter has been derived from.

setDataType

Sets the layer type for the created vector layer.

supportedOutputVectorLayerExtensions

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

toOutputDefinition

rtype

QgsProcessingOutputDefinition

toVariantMap

rtype

Dict[str, Any]

type

rtype

str

typeName

Returns the type name for the parameter class.

valueAsPythonString

param value

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass)str
Parameters

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) –

Return type

str

asScriptCode(self)str
Return type

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None)bool
Parameters
Return type

bool

clone(self)QgsProcessingParameterDefinition
Return type

QgsProcessingParameterDefinition

createFileFilter(self)str
Return type

str

dataType(self)QgsProcessing.SourceType

Returns the layer type for this created vector layer.

See also

setDataType()

Return type

QgsProcessing.SourceType

defaultFileExtension(self)str
Return type

str

fromScriptCode(name: str, description: str, isOptional: bool, definition: str)QgsProcessingParameterVectorDestination

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

Parameters
  • name (str) –

  • description (str) –

  • isOptional (bool) –

  • definition (str) –

Return type

QgsProcessingParameterVectorDestination

fromVariantMap(self, map: Dict[str, Any])bool
Parameters

map (Dict[str) –

Return type

bool

hasGeometry(self)bool

Returns True if the created layer 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

originalProvider(self)QgsProcessingProvider

Original (source) provider which this parameter has been derived from. In the case of destination parameters which are part of model algorithms, this will reflect the child algorithm’s provider which actually generates the parameter, as opposed to the provider which this parameter belongs to (i.e. the model provider)

New in version 3.2.

setDataType(self, type: QgsProcessing.SourceType)

Sets the layer type for the created vector layer.

See also

dataType()

Parameters

type (QgsProcessing.SourceType) –

supportedOutputVectorLayerExtensions(self)List[str]

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

New in version 3.2.

Return type

List[str]

toOutputDefinition(self)QgsProcessingOutputDefinition
Return type

QgsProcessingOutputDefinition

toVariantMap(self)Dict[str, Any]
Return type

Dict[str, Any]

type(self)str
Return type

str

typeName()str

Returns the type name for the parameter class.

Return type

str

valueAsPythonString(self, value: Any, context: QgsProcessingContext)str
Parameters
Return type

str