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¶
Base classes¶
An abstract base class for classes which transform geometries by transforming input points to output points. |
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. |
- class qgis.analysis.QgsGcpGeometryTransformer[source]¶
Bases:
QgsAbstractGeometryTransformer- __init__(gcpTransformer: QgsGcpTransformerInterface | None)
Constructor for QgsGcpGeometryTransformer, which uses the specified
gcpTransformerto modify geometries.Ownership of
gcpTransformeris 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
methodand list of source and destination coordinates to transform geometries.- Parameters:
sourceCoordinates (Iterable[QgsPointXY])
destinationCoordinates (Iterable[QgsPointXY])
- gcpTransformer(self) QgsGcpTransformerInterface | None[source]¶
Returns the underlying GCP transformer used to transform geometries.
See also
- Return type:
Optional[QgsGcpTransformerInterface]
- setGcpTransformer(self, transformer: QgsGcpTransformerInterface | None)[source]¶
Sets the underlying GCP
transformerused to transform geometries.Ownership is transferred to this object.
See also
- Parameters:
transformer (Optional[QgsGcpTransformerInterface])
- transform(self, geometry: QgsGeometry, feedback: QgsFeedback | None = None)[source]¶
Transforms the specified input
geometryusing 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:
Trueif geometry was successfully transformed, orFalseif an error occurred