Class: QgsRemappingProxyFeatureSink

A QgsFeatureSink which proxies incoming features to a destination feature sink, after applying transformations and field value mappings.

This sink allows for transformation of incoming features to match the requirements of storing in an existing destination layer, e.g. by reprojecting the features to the destination’s CRS and by coercing geometries to the format required by the destination sink.

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRemappingProxyFeatureSink

Base classes

QgsFeatureSink

An interface for objects which accept features via addFeature(s) methods.

Methods

destinationSink

Returns the destination QgsFeatureSink which the proxy will forward features to.

remapFeature

Remaps a feature to a set of features compatible with the destination sink.

setExpressionContext

Sets the expression context to use when evaluating mapped field values.

setTransformContext

Sets the transform context to use when reprojecting features.

class qgis.core.QgsRemappingProxyFeatureSink[source]

Bases: QgsFeatureSink

__init__(mappingDefinition: QgsRemappingSinkDefinition, sink: QgsFeatureSink | None)

Constructor for QgsRemappingProxyFeatureSink, using the specified mappingDefinition to manipulate features before sending them to the destination sink.

Parameters:
__init__(a0: QgsRemappingProxyFeatureSink)
Parameters:

a0 (QgsRemappingProxyFeatureSink)

destinationSink(self) QgsFeatureSink | None[source]

Returns the destination QgsFeatureSink which the proxy will forward features to.

Return type:

Optional[QgsFeatureSink]

remapFeature(self, feature: QgsFeature) List[QgsFeature][source]

Remaps a feature to a set of features compatible with the destination sink.

Parameters:

feature (QgsFeature)

Return type:

List[QgsFeature]

setExpressionContext(self, context: QgsExpressionContext)[source]

Sets the expression context to use when evaluating mapped field values.

Parameters:

context (QgsExpressionContext)

setTransformContext(self, context: QgsCoordinateTransformContext)[source]

Sets the transform context to use when reprojecting features.

Parameters:

context (QgsCoordinateTransformContext)