Class: QgsRemappingSinkDefinition

class qgis.core.QgsRemappingSinkDefinition

Bases: sip.wrapper

Defines the parameters used to remap features when creating a QgsRemappingProxyFeatureSink.

The definition includes parameters required to correctly map incoming features to the structure of the destination sink, e.g. information about how to create output field values and how to transform geometries to match the destination CRS.

Methods

addMappedField

Adds a mapping for a destination field.

destinationCrs

Returns the destination CRS used for reprojecting incoming features to the sink’s destination CRS.

destinationFields

Returns the fields for the destination sink.

destinationWkbType

Returns the WKB geometry type for the destination.

fieldMap

Returns the field mapping, which defines how to map the values from incoming features to destination field values.

loadVariant

Loads this remapping definition from a QVariantMap, wrapped in a QVariant.

setDestinationCrs

Sets the destination crs used for reprojecting incoming features to the sink’s destination CRS.

setDestinationFields

Sets the fields for the destination sink.

setDestinationWkbType

Sets the WKB geometry type for the destination.

setFieldMap

Sets the field mapping, which defines how to map the values from incoming features to destination field values.

setSourceCrs

Sets the source crs used for reprojecting incoming features to the sink’s destination CRS.

sourceCrs

Returns the source CRS used for reprojecting incoming features to the sink’s destination CRS.

toVariant

Saves this remapping definition to a QVariantMap, wrapped in a QVariant.

addMappedField(self, destinationField: str, property: QgsProperty)

Adds a mapping for a destination field.

Field values are mapped using a QgsProperty source object, which allows either direct field value to field value mapping or use of QgsExpression expressions to transform values to the destination field.

See also

setFieldMap()

See also

fieldMap()

Parameters
  • destinationField (str) –

  • property (QgsProperty) –

destinationCrs(self)QgsCoordinateReferenceSystem

Returns the destination CRS used for reprojecting incoming features to the sink’s destination CRS.

Return type

QgsCoordinateReferenceSystem

destinationFields(self)QgsFields

Returns the fields for the destination sink.

Return type

QgsFields

destinationWkbType(self)QgsWkbTypes.Type

Returns the WKB geometry type for the destination.

Return type

QgsWkbTypes.Type

fieldMap(self) → Dict[str, QgsProperty]

Returns the field mapping, which defines how to map the values from incoming features to destination field values.

Field values are mapped using a QgsProperty source object, which allows either direct field value to field value mapping or use of QgsExpression expressions to transform values to the destination field.

See also

setFieldMap()

See also

addMappedField()

Return type

Dict[str, QgsProperty]

loadVariant(self, map: Dict[str, Any]) → bool

Loads this remapping definition from a QVariantMap, wrapped in a QVariant. You can use QgsXmlUtils.readVariant to load it from an XML document.

See also

toVariant()

Parameters

map (Dict[str) –

Return type

bool

setDestinationCrs(self, destination: QgsCoordinateReferenceSystem)

Sets the destination crs used for reprojecting incoming features to the sink’s destination CRS.

See also

destinationCrs()

Parameters

destination (QgsCoordinateReferenceSystem) –

setDestinationFields(self, fields: QgsFields)

Sets the fields for the destination sink.

Parameters

fields (QgsFields) –

setDestinationWkbType(self, type: QgsWkbTypes.Type)

Sets the WKB geometry type for the destination.

Parameters

type (QgsWkbTypes.Type) –

setFieldMap(self, map: Dict[str, QgsProperty])

Sets the field mapping, which defines how to map the values from incoming features to destination field values.

Field values are mapped using a QgsProperty source object, which allows either direct field value to field value mapping or use of QgsExpression expressions to transform values to the destination field.

See also

fieldMap()

See also

addMappedField()

Parameters

map (Dict[str) –

setSourceCrs(self, source: QgsCoordinateReferenceSystem)

Sets the source crs used for reprojecting incoming features to the sink’s destination CRS.

See also

sourceCrs()

Parameters

source (QgsCoordinateReferenceSystem) –

sourceCrs(self)QgsCoordinateReferenceSystem

Returns the source CRS used for reprojecting incoming features to the sink’s destination CRS.

See also

setSourceCrs()

Return type

QgsCoordinateReferenceSystem

toVariant(self) → Any

Saves this remapping definition to a QVariantMap, wrapped in a QVariant. You can use QgsXmlUtils.writeVariant to save it to an XML document.

See also

loadVariant()

Return type

Any