QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
An interface for Ground Control Points (GCP) based transformations. More...
#include <qgsgcptransformer.h>
Public Types | |
enum class | TransformMethod : int { Linear , Helmert , PolynomialOrder1 , PolynomialOrder2 , PolynomialOrder3 , ThinPlateSpline , Projective , InvalidTransform = 65535 } |
Available transformation methods. More... | |
Public Member Functions | |
QgsGcpTransformerInterface ()=default | |
QgsGcpTransformerInterface (const QgsGcpTransformerInterface &other)=delete | |
QgsGcpTransformerInterface cannot be copied - use clone() instead. | |
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. | |
virtual GDALTransformerFunc | GDALTransformer () const =0 |
Returns function pointer to the GDALTransformer function. | |
virtual void * | GDALTransformerArgs () const =0 |
Returns pointer to the GDALTransformer arguments. | |
virtual TransformMethod | method () const =0 |
Returns the transformation method. | |
virtual int | minimumGcpCount () const =0 |
Returns the minimum number of Ground Control Points (GCPs) required for parameter fitting. | |
QgsGcpTransformerInterface & | operator= (const QgsGcpTransformerInterface &other)=delete |
QgsGcpTransformerInterface cannot be copied - use clone() instead. | |
bool | transform (double &x, double &y, bool inverseTransform=false) const |
Transforms the point (x, y) from source to destination coordinates. | |
virtual bool | updateParametersFromGcps (const QVector< QgsPointXY > &sourceCoordinates, const QVector< QgsPointXY > &destinationCoordinates, bool invertYAxis=false)=0 |
Fits transformation parameters using the specified Ground Control Points (GCPs) lists of source and destination coordinates. | |
Static Public Member Functions | |
static QgsGcpTransformerInterface * | create (TransformMethod method) |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method. | |
static QgsGcpTransformerInterface * | createFromParameters (TransformMethod method, const QVector< QgsPointXY > &sourceCoordinates, const QVector< QgsPointXY > &destinationCoordinates) |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method, initialized using the given lists of source and destination coordinates. | |
static QString | methodToString (TransformMethod method) |
Returns a translated string representing the specified transform method. | |
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 34 of file qgsgcptransformer.h.
|
strong |
Available transformation methods.
Definition at line 42 of file qgsgcptransformer.h.
|
default |
|
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 QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.
|
static |
Creates a new QgsGcpTransformerInterface subclass representing the specified transform method.
Caller takes ownership of the returned object.
Definition at line 71 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 94 of file qgsgcptransformer.cpp.
|
pure virtual |
Returns function pointer to the GDALTransformer function.
Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.
|
pure virtual |
Returns pointer to the GDALTransformer arguments.
Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.
|
pure virtual |
Returns the transformation method.
Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.
|
static |
Returns a translated string representing the specified transform method.
Definition at line 48 of file qgsgcptransformer.cpp.
|
pure virtual |
Returns the minimum number of Ground Control Points (GCPs) required for parameter fitting.
Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.
|
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 30 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 QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.