Class: QgsRemappingProxyFeatureSink

class qgis.core.QgsRemappingProxyFeatureSink(mappingDefinition: QgsRemappingSinkDefinition, sink: QgsFeatureSink)

Bases: QgsFeatureSink

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

QgsRemappingProxyFeatureSink(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.

New in version 3.14.

Parameters
addFeature(self, feature: QgsFeature, flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = QgsFeatureSink.Flags()) → bool
Parameters
Return type

bool

addFeatures(self, features: Iterable[QgsFeature], flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = QgsFeatureSink.Flags()) → bool

addFeatures(self, iterator: QgsFeatureIterator, flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = QgsFeatureSink.Flags()) -> bool

Parameters
Return type

bool

destinationSink(self)QgsFeatureSink

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

Return type

QgsFeatureSink

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

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

Parameters

feature (QgsFeature) –

Return type

List[QgsFeature]

setExpressionContext(self, context: QgsExpressionContext)

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

Parameters

context (QgsExpressionContext) –

setTransformContext(self, context: QgsCoordinateTransformContext)

Sets the transform context to use when reprojecting features.

Parameters

context (QgsCoordinateTransformContext) –