QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsRemappingProxyFeatureSink Class Reference

A QgsFeatureSink which proxies incoming features to a destination feature sink, after applying transformations and field value mappings. More...

#include <qgsremappingproxyfeaturesink.h>

Inheritance diagram for QgsRemappingProxyFeatureSink:
Inheritance graph
[legend]

Public Member Functions

 QgsRemappingProxyFeatureSink (const QgsRemappingSinkDefinition &mappingDefinition, QgsFeatureSink *sink, bool ownsSink=false)
 Constructor for QgsRemappingProxyFeatureSink, using the specified mappingDefinition to manipulate features before sending them to the destination sink.
 
 ~QgsRemappingProxyFeatureSink () override
 
bool addFeature (QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
 Adds a single feature to the sink.
 
bool addFeatures (QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
 Adds all features from the specified iterator to the sink.
 
bool addFeatures (QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
 Adds a list of features to the sink.
 
QgsFeatureSinkdestinationSink ()
 Returns the destination QgsFeatureSink which the proxy will forward features to.
 
QString lastError () const override
 Returns the most recent error encountered by the sink, e.g.
 
QgsFeatureList remapFeature (const QgsFeature &feature) const
 Remaps a feature to a set of features compatible with the destination sink.
 
void setExpressionContext (const QgsExpressionContext &context) const
 Sets the expression context to use when evaluating mapped field values.
 
void setTransformContext (const QgsCoordinateTransformContext &context)
 Sets the transform context to use when reprojecting features.
 
- Public Member Functions inherited from QgsFeatureSink
virtual ~QgsFeatureSink ()=default
 
virtual void finalize ()
 Finalizes the sink, flushing any buffered features to the destination.
 
virtual bool flushBuffer ()
 Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink's destination.
 

Additional Inherited Members

- Public Types inherited from QgsFeatureSink
enum  Flag { FastInsert = 1 << 1 , RollBackOnErrors = 1 << 2 }
 Flags controlling how features are added to a sink. More...
 
typedef QFlags< FlagFlags
 
enum  SinkFlag { RegeneratePrimaryKey = 1 << 1 }
 Flags that can be set on a QgsFeatureSink. More...
 
typedef QFlags< SinkFlagSinkFlags
 

Detailed Description

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.

Since
QGIS 3.14

Definition at line 180 of file qgsremappingproxyfeaturesink.h.

Constructor & Destructor Documentation

◆ QgsRemappingProxyFeatureSink()

QgsRemappingProxyFeatureSink::QgsRemappingProxyFeatureSink ( const QgsRemappingSinkDefinition mappingDefinition,
QgsFeatureSink sink,
bool  ownsSink = false 
)

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

Ownership of sink is dictated by ownsSink. If ownsSink is false, ownership is not transferred, and callers must ensure that sink exists for the lifetime of this object. If ownsSink is true, then this object will take ownership of sink.

Definition at line 21 of file qgsremappingproxyfeaturesink.cpp.

◆ ~QgsRemappingProxyFeatureSink()

QgsRemappingProxyFeatureSink::~QgsRemappingProxyFeatureSink ( )
override

Definition at line 28 of file qgsremappingproxyfeaturesink.cpp.

Member Function Documentation

◆ addFeature()

bool QgsRemappingProxyFeatureSink::addFeature ( QgsFeature feature,
QgsFeatureSink::Flags  flags = QgsFeatureSink::Flags() 
)
overridevirtual

Adds a single feature to the sink.

Feature addition behavior is controlled by the specified flags.

See also
addFeatures()
Returns
true in case of success and false in case of failure

Reimplemented from QgsFeatureSink.

Definition at line 106 of file qgsremappingproxyfeaturesink.cpp.

◆ addFeatures() [1/2]

bool QgsRemappingProxyFeatureSink::addFeatures ( QgsFeatureIterator iterator,
QgsFeatureSink::Flags  flags = QgsFeatureSink::Flags() 
)
overridevirtual

Adds all features from the specified iterator to the sink.

Feature addition behavior is controlled by the specified flags.

Returns
true if all features were added successfully, or false if any feature could not be added

Reimplemented from QgsFeatureSink.

Definition at line 122 of file qgsremappingproxyfeaturesink.cpp.

◆ addFeatures() [2/2]

bool QgsRemappingProxyFeatureSink::addFeatures ( QgsFeatureList features,
QgsFeatureSink::Flags  flags = QgsFeatureSink::Flags() 
)
overridevirtual

Adds a list of features to the sink.

Feature addition behavior is controlled by the specified flags.

See also
addFeature()
Returns
true in case of success and false in case of failure

Implements QgsFeatureSink.

Definition at line 112 of file qgsremappingproxyfeaturesink.cpp.

◆ destinationSink()

QgsFeatureSink * QgsRemappingProxyFeatureSink::destinationSink ( )
inline

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

Definition at line 229 of file qgsremappingproxyfeaturesink.h.

◆ lastError()

QString QgsRemappingProxyFeatureSink::lastError ( ) const
overridevirtual

Returns the most recent error encountered by the sink, e.g.

when a call to addFeatures() returns false.

Since
QGIS 3.16

Reimplemented from QgsFeatureSink.

Definition at line 133 of file qgsremappingproxyfeaturesink.cpp.

◆ remapFeature()

QgsFeatureList QgsRemappingProxyFeatureSink::remapFeature ( const QgsFeature feature) const

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

Definition at line 44 of file qgsremappingproxyfeaturesink.cpp.

◆ setExpressionContext()

void QgsRemappingProxyFeatureSink::setExpressionContext ( const QgsExpressionContext context) const

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

Definition at line 34 of file qgsremappingproxyfeaturesink.cpp.

◆ setTransformContext()

void QgsRemappingProxyFeatureSink::setTransformContext ( const QgsCoordinateTransformContext context)

Sets the transform context to use when reprojecting features.

Definition at line 39 of file qgsremappingproxyfeaturesink.cpp.


The documentation for this class was generated from the following files: