QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
An interface for Ground Control Points (GCP) based transformations. More...
#include <qgsgcptransformer.h>
Public Types | |
enum | TransformMethod : int { TransformMethod::Linear, TransformMethod::Helmert, TransformMethod::PolynomialOrder1, TransformMethod::PolynomialOrder2, TransformMethod::PolynomialOrder3, TransformMethod::ThinPlateSpline, TransformMethod::Projective, TransformMethod::InvalidTransform = 65535 } |
Available transformation methods. More... | |
Public Member Functions | |
QgsGcpTransformerInterface ()=default | |
Constructor for QgsGcpTransformerInterface. More... | |
QgsGcpTransformerInterface (const QgsGcpTransformerInterface &other)=delete | |
QgsGcpTransformerInterface cannot be copied - use clone() instead. More... | |
virtual | ~QgsGcpTransformerInterface ()=default |
virtual QgsGcpTransformerInterface * | clone () const =0 |
Clones the transformer, returning a new copy of the transformer with the same parameters as this one. More... | |
virtual GDALTransformerFunc | GDALTransformer () const =0 |
Returns function pointer to the GDALTransformer function. More... | |
virtual void * | GDALTransformerArgs () const =0 |
Returns pointer to the GDALTransformer arguments. More... | |
virtual TransformMethod | method () const =0 |
Returns the transformation method. More... | |
virtual int | minimumGcpCount () const =0 |
Returns the minimum number of Ground Control Points (GCPs) required for parameter fitting. More... | |
QgsGcpTransformerInterface & | operator= (const QgsGcpTransformerInterface &other)=delete |
QgsGcpTransformerInterface cannot be copied - use clone() instead. More... | |
bool | transform (double &x, double &y, bool inverseTransform=false) const |
Transforms the point (x, y) from source to destination coordinates. More... | |
virtual bool | updateParametersFromGcps (const QVector< QgsPointXY > &sourceCoordinates, const QVector< QgsPointXY > &destinationCoordinates, bool invertYAxis=false) SIP_THROW(QgsNotSupportedException)=0 |
Fits transformation parameters using the specified Ground Control Points (GCPs) lists of source and destination coordinates. More... | |
Static Public Member Functions | |
static QgsGcpTransformerInterface * | create (TransformMethod method) |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method. More... | |
static QgsGcpTransformerInterface * | createFromParameters (TransformMethod method, const QVector< QgsPointXY > &sourceCoordinates, const QVector< QgsPointXY > &destinationCoordinates) SIP_THROW(QgsNotSupportedException) |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method, initialized using the given lists of source and destination coordinates. More... | |
static QString | methodToString (TransformMethod method) |
Returns a translated string representing the specified transform method. More... | |
An interface for Ground Control Points (GCP) based transformations.
QgsGcpTransformerInterface implementations are able to transform point locations based on a transformation method and a list of GCPs.
Definition at line 33 of file qgsgcptransformer.h.
|
strong |
Available transformation methods.
Definition at line 55 of file qgsgcptransformer.h.
|
default |
Constructor for QgsGcpTransformerInterface.
|
virtualdefault |
|
delete |
QgsGcpTransformerInterface cannot be copied - use clone() instead.
|
pure virtual |
Clones the transformer, returning a new copy of the transformer with the same parameters as this one.
Caller takes ownership of the returned object.
Implemented in QgsProjectiveGeorefTransform, QgsGDALGeorefTransform, QgsHelmertGeorefTransform, and QgsLinearGeorefTransform.
|
static |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method.
Caller takes ownership of the returned object.
Definition at line 70 of file qgsgcptransformer.cpp.
|
static |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method, initialized using the given lists of source and destination coordinates.
If the parameters cannot be fit to a transform nullptr
will be returned.
Caller takes ownership of the returned object.
Definition at line 93 of file qgsgcptransformer.cpp.
|
pure virtual |
Returns function pointer to the GDALTransformer function.
Implemented in QgsProjectiveGeorefTransform, QgsGDALGeorefTransform, QgsHelmertGeorefTransform, and QgsLinearGeorefTransform.
|
pure virtual |
Returns pointer to the GDALTransformer arguments.
Implemented in QgsProjectiveGeorefTransform, QgsGDALGeorefTransform, QgsHelmertGeorefTransform, and QgsLinearGeorefTransform.
|
pure virtual |
Returns the transformation method.
Implemented in QgsProjectiveGeorefTransform, QgsGDALGeorefTransform, QgsHelmertGeorefTransform, and QgsLinearGeorefTransform.
|
static |
Returns a translated string representing the specified transform method.
Definition at line 47 of file qgsgcptransformer.cpp.
|
pure virtual |
Returns the minimum number of Ground Control Points (GCPs) required for parameter fitting.
Implemented in QgsProjectiveGeorefTransform, QgsGDALGeorefTransform, QgsHelmertGeorefTransform, and QgsLinearGeorefTransform.
|
delete |
QgsGcpTransformerInterface cannot be copied - use clone() instead.
bool QgsGcpTransformerInterface::transform | ( | double & | x, |
double & | y, | ||
bool | inverseTransform = false |
||
) | const |
Transforms the point (x, y) from source to destination coordinates.
If inverseTransform is set to true
, the point will be transformed from the destination to the source.
true
if transformation was successful. Definition at line 29 of file qgsgcptransformer.cpp.
|
pure virtual |
Fits transformation parameters using the specified Ground Control Points (GCPs) lists of source and destination coordinates.
If invertYAxis is set to true
then the y-axis of source coordinates will be inverted, e.g. to allow for transformation of raster layers with ascending top-to-bottom vertical axis coordinates.
true
on success, false
on failure Implemented in QgsProjectiveGeorefTransform, QgsGDALGeorefTransform, QgsHelmertGeorefTransform, and QgsLinearGeorefTransform.