Class: QgsProcessingParameterFeatureSink¶
- class qgis.core.QgsProcessingParameterFeatureSink¶
Bases:
QgsProcessingDestinationParameter
A feature sink output for processing algorithms.
A parameter which represents the destination feature sink for features created by an algorithm.
New in version 3.0.
QgsProcessingParameterFeatureSink(name: str, description: str = ‘’, type: QgsProcessing.SourceType = QgsProcessing.TypeVectorAnyGeometry, defaultValue: Any = None, optional: bool = False, createByDefault: bool = True, supportsAppend: bool = False) Constructor for QgsProcessingParameterFeatureSink.
If
createByDefault
isFalse
and the parameter isoptional
, then this destination output will not be created by default.QgsProcessingParameterFeatureSink(
QgsProcessingParameterFeatureSink
)Methods
- param outputType
- rtype
str
- param input
- rtype
QgsProcessingParameterDefinition
- rtype
str
Returns the layer type for sinks associated with the parameter.
- rtype
str
Creates a new parameter using the definition from a script code.
- param map
- rtype
str
Returns
True
if sink is likely to include geometries.Original (source) provider which this parameter has been derived from.
Sets the layer
type
for the sinks associated with the parameter.Sets whether the sink supports appending features to an existing table.
Returns a list of the vector format file extensions supported by this parameter.
Returns
True
if the sink supports appending features to an existing table.- rtype
QgsProcessingOutputDefinition
- rtype
Dict[str, Any]
- rtype
str
Returns the type name for the parameter class.
- 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
input (Any) –
context (
QgsProcessingContext
= None) –
- Return type
bool
- clone(self) QgsProcessingParameterDefinition ¶
- Return type
- createFileFilter(self) str ¶
- Return type
str
- dataType(self) QgsProcessing.SourceType ¶
Returns the layer type for sinks associated with the parameter.
See also
- Return type
- defaultFileExtension(self) str ¶
- Return type
str
- fromScriptCode(name: str, description: str, isOptional: bool, definition: str) QgsProcessingParameterFeatureSink ¶
Creates a new parameter using the definition from a script code.
- Parameters
name (str) –
description (str) –
isOptional (bool) –
definition (str) –
- Return type
- fromVariantMap(self, map: Dict[str, Any]) bool ¶
- Parameters
map (Dict[str) –
- Return type
bool
- generateTemporaryDestination(self) str ¶
- Return type
str
- hasGeometry(self) bool ¶
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 returningTrue
.- 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 sinks associated with the parameter.See also
- Parameters
type (QgsProcessing.SourceType) –
- setSupportsAppend(self, supportsAppend: bool)¶
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
New in version 3.14.
- Parameters
supportsAppend (bool) –
- supportedOutputVectorLayerExtensions(self) List[str] ¶
Returns a list of the vector format file extensions supported by this parameter.
See also
New in version 3.2.
- Return type
List[str]
- supportsAppend(self) bool ¶
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.See also
New in version 3.14.
- Return type
bool
- toOutputDefinition(self) QgsProcessingOutputDefinition ¶
- Return type
- 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
value (Any) –
context (QgsProcessingContext) –
- Return type
str