QgsFeatureStore class

A container for features with the same fields and crs.

Base classes

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

Constructors, destructors, conversion operators

QgsFeatureStore() defaulted
Constructor.
QgsFeatureStore(const QgsFields& fields, const QgsCoordinateReferenceSystem& crs)
Constructor.

Public functions

auto addFeature(QgsFeature& feature, QgsFeatureSink::Flags flags = nullptr) -> bool override
Adds a single feature to the sink.
auto addFeatures(QgsFeatureList& features, QgsFeatureSink::Flags flags = nullptr) -> bool override
Adds a list of features to the sink.
auto count() const -> int
Returns the number of features contained in the store.
auto crs() const -> QgsCoordinateReferenceSystem
Returns the store's coordinate reference system.
auto features() const -> QgsFeatureList
Returns the list of features contained in the store.
auto fields() const -> QgsFields
Returns the store's field list.
auto params() const -> QMap<QString, QVariant>
Returns the map of optional parameters.
void setCrs(const QgsCoordinateReferenceSystem& crs)
Sets the store's crs.
void setFields(const QgsFields& fields)
Sets the store's fields.
void setParams(const QMap<QString, QVariant>& parameters)
Sets a map of optional parameters for the store.

Function documentation

bool QgsFeatureStore::addFeature(QgsFeature& feature, QgsFeatureSink::Flags flags = nullptr) override

Adds a single feature to the sink.

Returns true in case of success and false in case of failure

Feature addition behavior is controlled by the specified flags.

bool QgsFeatureStore::addFeatures(QgsFeatureList& features, QgsFeatureSink::Flags flags = nullptr) override

Adds a list of features to the sink.

Returns true in case of success and false in case of failure

Feature addition behavior is controlled by the specified flags.

QgsCoordinateReferenceSystem QgsFeatureStore::crs() const

Returns the store's coordinate reference system.

QgsFields QgsFeatureStore::fields() const

Returns the store's field list.

QMap<QString, QVariant> QgsFeatureStore::params() const

Returns the map of optional parameters.

void QgsFeatureStore::setCrs(const QgsCoordinateReferenceSystem& crs)

Sets the store's crs.

void QgsFeatureStore::setFields(const QgsFields& fields)

Sets the store's fields.

Every contained feature's fields will be reset to match fields.

void QgsFeatureStore::setParams(const QMap<QString, QVariant>& parameters)

Sets a map of optional parameters for the store.