Class: QgsProxyFeatureSink

A simple feature sink which proxies feature addition onto another feature sink.

This class is designed to allow factory methods which always return new QgsFeatureSink objects. Since it is not always possible to create an entirely new QgsFeatureSink (e.g. if the feature sink is a layer’s data provider), a new QgsProxyFeatureSink can instead be returned which forwards features on to the destination sink. The proxy sink can be safely deleted without affecting the destination sink.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProxyFeatureSink

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.

class qgis.core.QgsProxyFeatureSink[source]

Bases: QgsFeatureSink

__init__(sink: QgsFeatureSink | None)

Constructs a new QgsProxyFeatureSink which forwards features onto a destination sink.

Parameters:

sink (Optional[QgsFeatureSink])

__init__(a0: QgsProxyFeatureSink)
Parameters:

a0 (QgsProxyFeatureSink)

destinationSink(self) QgsFeatureSink | None[source]

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

Return type:

Optional[QgsFeatureSink]