Class: QgsGcpGeometryTransformer

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

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.analysis.QgsGcpGeometryTransformer

Base classes

QgsAbstractGeometryTransformer

An abstract base class for classes which transform geometries by transforming input points to output points.

Methods

gcpTransformer

Returns the underlying GCP transformer used to transform geometries.

setGcpTransformer

Sets the underlying GCP transformer used to transform geometries.

transform

Transforms the specified input geometry using the GCP based transform.

class qgis.analysis.QgsGcpGeometryTransformer[source]

Bases: QgsAbstractGeometryTransformer

__init__(gcpTransformer: QgsGcpTransformerInterface | None)

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

Ownership of gcpTransformer is transferred to the geometry transformer.

Parameters:

gcpTransformer (Optional[QgsGcpTransformerInterface])

__init__(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.

Parameters:
gcpTransformer(self) QgsGcpTransformerInterface | None[source]

Returns the underlying GCP transformer used to transform geometries.

Return type:

Optional[QgsGcpTransformerInterface]

setGcpTransformer(self, transformer: QgsGcpTransformerInterface | None)[source]

Sets the underlying GCP transformer used to transform geometries.

Ownership is transferred to this object.

See also

gcpTransformer()

Parameters:

transformer (Optional[QgsGcpTransformerInterface])

transform(self, geometry: QgsGeometry, feedback: QgsFeedback | None = None)[source]

Transforms the specified input geometry using the GCP based transform.

Parameters:
  • geometry (QgsGeometry) – Input geometry to transform

  • feedback (Optional[QgsFeedback] = None) -> (QgsGeometry) – 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.

Returns:

  • transformed geometry

  • ok: True if geometry was successfully transformed, or False if an error occurred