Class: QgsGcpGeometryTransformer¶
- class qgis.analysis.QgsGcpGeometryTransformer¶
Bases:
QgsAbstractGeometryTransformer
A geometry transformer which uses an underlying Ground Control Points (GCP) based transformation to modify geometries.
New in version 3.18.
QgsGcpGeometryTransformer(gcpTransformer:
QgsGcpTransformerInterface
) Constructor forQgsGcpGeometryTransformer
, which uses the specifiedgcpTransformer
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 transformmethod
and list of source and destination coordinates to transform geometries.Methods
Returns the underlying GCP transformer used to transform geometries.
Sets the underlying GCP
transformer
used to transform geometries.Transforms the specified input
geometry
using the GCP based transform.QgsGcpGeometryTransformer
cannot be copied- gcpTransformer(self) QgsGcpTransformerInterface ¶
Returns the underlying GCP transformer used to transform geometries.
See also
- Return type
- setGcpTransformer(self, transformer: QgsGcpTransformerInterface)¶
Sets the underlying GCP
transformer
used to transform geometries.Ownership is transferred to this object.
See also
- 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, orFalse
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]