Class: QgsRemappingProxyFeatureSink¶
- class qgis.core.QgsRemappingProxyFeatureSink¶
Bases:
QgsFeatureSink
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.
New in version 3.14.
QgsRemappingProxyFeatureSink(mappingDefinition:
QgsRemappingSinkDefinition
, sink:QgsFeatureSink
) Constructor forQgsRemappingProxyFeatureSink
, using the specifiedmappingDefinition
to manipulate features before sending them to the destinationsink
.QgsRemappingProxyFeatureSink(
QgsRemappingProxyFeatureSink
)Methods
- param feature
- param features
Returns the destination
QgsFeatureSink
which the proxy will forward features to.- rtype
str
Remaps a
feature
to a set of features compatible with the destination sink.Sets the expression
context
to use when evaluating mapped field values.Sets the transform
context
to use when reprojecting features.- 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
- remapFeature(self, feature: QgsFeature) List[QgsFeature] ¶
Remaps a
feature
to a set of features compatible with the destination sink.- Parameters
feature (QgsFeature) –
- Return type
List[QgsFeature]
- setExpressionContext(self, context: QgsExpressionContext)¶
Sets the expression
context
to use when evaluating mapped field values.- Parameters
context (QgsExpressionContext) –
- setTransformContext(self, context: QgsCoordinateTransformContext)¶
Sets the transform
context
to use when reprojecting features.- Parameters
context (QgsCoordinateTransformContext) –