Class: QgsGcpGeometryTransformer

class qgis.analysis.QgsGcpGeometryTransformer(gcpTransformer: QgsGcpTransformerInterface)

Bases: QgsAbstractGeometryTransformer

Constructor for QgsGcpGeometryTransformer, which uses the specified gcpTransformer to modify geometries.

Ownership of gcpTransformer is transferred to the geometry transformer.

QgsGcpGeometryTransformer(method: QgsGcpTransformerInterface.TransformMethod, sourceCoordinates: Iterable[QgsPointXY], destinationCoordinates: Iterable[QgsPointXY]) Constructor for QgsGcpGeometryTransformer, which uses the specified transform method and list of source and destination coordinates to transform geometries.

A geometry transformer which uses an underlying Ground Control Points (GCP) based transformation to modify geometries.

New in version 3.18.

Parameters

gcpTransformer

gcpTransformer(self)QgsGcpTransformerInterface

Returns the underlying GCP transformer used to transform geometries.

Return type

QgsGcpTransformerInterface

setGcpTransformer(self, transformer: QgsGcpTransformerInterface)

Sets the underlying GCP transformer used to transform geometries.

Ownership is transferred to this object.

See also

gcpTransformer()

Parameters

transformer (QgsGcpTransformerInterface) –

transform(self, geometry: QgsGeometry, feedback: QgsFeedback = None) → Tuple[QgsGeometry, bool]

Transforms the specified input geometry using the GCP based transform.

Parameters
  • geometry (QgsGeometry) – Input geometry to transform

  • feedback (QgsFeedback = None) – This optional argument can be used to cancel the transformation before it completes. If this is done, the geometry will be left in a semi-transformed state.

Return type

Tuple[QgsGeometry, bool]

Returns

  • transformed geometry

  • ok: will be set to True if geometry was successfully transformed, or False if an error occurred

transformPoint(self, x: float, y: float, z: float, m: float) → Tuple[bool, float, float, float, float]

QgsGcpGeometryTransformer cannot be copied

Parameters
  • x (float) –

  • y (float) –

  • z (float) –

  • m (float) –

Return type

Tuple[bool, float, float, float, float]