Class: QgsProxyFeatureSink¶
- class qgis.core.QgsProxyFeatureSink(sink: QgsFeatureSink)¶
Bases:
QgsFeatureSink
Constructs a new
QgsProxyFeatureSink
which forwards features onto a destinationsink
.QgsProxyFeatureSink(
QgsProxyFeatureSink
)A simple feature sink which proxies feature addition on to 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 newQgsFeatureSink
(e.g. if the feature sink is a layer’s data provider), a newQgsProxyFeatureSink
can instead be returned which forwards features on to the destination sink. The proxy sink can be safely deleted without affecting the destination sink.Methods
- param feature
- param features
Returns the destination
QgsFeatureSink
which the proxy will forward features to.- rtype
str
- addFeature(self, feature: QgsFeature, flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = QgsFeatureSink.Flags()) → bool¶
- Parameters
feature (QgsFeature) –
flags (Union[QgsFeatureSink.Flags) –
- 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
features (Iterable[QgsFeature]) –
flags (Union[QgsFeatureSink.Flags) –
- Return type
bool
- destinationSink(self) → QgsFeatureSink¶
Returns the destination
QgsFeatureSink
which the proxy will forward features to.- Return type
- lastError(self) → str¶
- Return type
str