Class: QgsProcessingOutputLayerDefinition¶
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm.
Methods
Loads this output layer definition from a QVariantMap, wrapped in a QVariant. |
|
Returns the output remapping definition, if |
|
Sets the remapping definition to use when adding features to the output layer. |
|
Saves this output layer definition to a QVariantMap, wrapped in a QVariant. |
|
Returns |
Attributes
Map of optional sink/layer creation options, which are passed to the underlying provider when creating new layers. |
|
Name to use for sink if it's to be loaded into a destination project. |
|
Destination project. |
|
Sink/layer definition. |
- class qgis.core.QgsProcessingOutputLayerDefinition[source]¶
Bases:
object
- __init__(sink: str | None = '', destinationProject: QgsProject | None = None)
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string. The
destinationProject
parameter can be set to aQgsProject
instance in which to automatically load the resulting sink/layer after completing processing.- Parameters:
sink (Optional[str] = '')
destinationProject (Optional[QgsProject] = None)
- __init__(sink: QgsProperty, destinationProject: QgsProject | None = None)
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer. The
destinationProject
parameter can be set to aQgsProject
instance in which to automatically load the resulting sink/layer after completing processing.- Parameters:
sink (QgsProperty)
destinationProject (Optional[QgsProject] = None)
- __init__(a0: QgsProcessingOutputLayerDefinition)
- Parameters:
- createOptions: Dict[str, object]¶
Map of optional sink/layer creation options, which are passed to the underlying provider when creating new layers. Known options also include ‘fileEncoding’, which is used to specify a file encoding to use for created files.
- destinationName: str¶
Name to use for sink if it’s to be loaded into a destination project.
- destinationProject: QgsProject¶
Destination project. Can be set to a
QgsProject
instance in which to automatically load the resulting sink/layer after completing processing. The default behavior is not to load the result into any project (None
).
- loadVariant(self, map: Dict[str, Any]) bool [source]¶
Loads this output layer definition from a QVariantMap, wrapped in a QVariant. You can use
QgsXmlUtils
.readVariant to load it from an XML document.See also
Added in version 3.2.
- Parameters:
map (Dict[str, Any])
- Return type:
bool
- remappingDefinition(self) QgsRemappingSinkDefinition [source]¶
Returns the output remapping definition, if
useRemapping()
isTrue
.See also
See also
Added in version 3.14.
- Return type:
- setRemappingDefinition(self, definition: QgsRemappingSinkDefinition)[source]¶
Sets the remapping
definition
to use when adding features to the output layer.Calling this method will set
useRemapping()
toTrue
.See also
See also
Added in version 3.14.
- Parameters:
definition (QgsRemappingSinkDefinition)
- sink: QgsProperty¶
Sink/layer definition. Usually a static property set to the destination file name for the sink’s layer.
- toVariant(self) Any [source]¶
Saves this output layer definition to a QVariantMap, wrapped in a QVariant. You can use
QgsXmlUtils
.writeVariant to save it to an XML document.See also
Added in version 3.2.
- Return type:
Any