Class: QgsFeatureSink¶
-
class
qgis.core.
QgsFeatureSink
¶ Bases:
sip.wrapper
An interface for objects which accept features via addFeature(s) methods.
Methods
Adds a single
feature
to the sink.Adds a list of
features
to the sink.Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink’s destination.
Attributes
-
FastInsert
= 2¶
-
class
Flag
¶ Bases:
int
-
class
Flags
¶ Bases:
sip.wrapper
QgsFeatureSink.Flags(Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag]) QgsFeatureSink.Flags(QgsFeatureSink.Flags)
-
RegeneratePrimaryKey
= 2¶
-
class
SinkFlag
¶ Bases:
int
-
class
SinkFlags
¶ Bases:
sip.wrapper
QgsFeatureSink.SinkFlags(Union[QgsFeatureSink.SinkFlags, QgsFeatureSink.SinkFlag]) QgsFeatureSink.SinkFlags(QgsFeatureSink.SinkFlags)
-
addFeature
(self, feature: QgsFeature, flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = 0) → bool¶ Adds a single
feature
to the sink. Feature addition behavior is controlled by the specifiedflags
.See also
- Return type
bool
- Returns
true in case of success and false in case of failure
- Parameters
feature (QgsFeature) –
flags (Union[QgsFeatureSink.Flags) –
-
addFeatures
(self, features: object, flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = 0) → bool¶ Adds a list of
features
to the sink. Feature addition behavior is controlled by the specifiedflags
.See also
- Returns
true in case of success and false in case of failure
addFeatures(self, iterator:
QgsFeatureIterator
, flags: Union[QgsFeatureSink.Flags, QgsFeatureSink.Flag] = 0) -> bool Adds all features from the specifiediterator
to the sink. Feature addition behavior is controlled by the specifiedflags
.- Return type
bool
- Returns
true if all features were added successfully, or false if any feature could not be added
- Parameters
features (object) –
flags (Union[QgsFeatureSink.Flags) –
-
flushBuffer
(self) → bool¶ Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink’s destination.
- Return type
bool
- Returns
false if any buffered features could not be added to the sink.
-