QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsGcpTransformerInterface Class Referenceabstract

An interface for Ground Control Points (GCP) based transformations. More...

#include <qgsgcptransformer.h>

Inheritance diagram for QgsGcpTransformerInterface:
Inheritance graph
[legend]

Public Types

enum class  TransformMethod : int {
  Linear , Helmert , PolynomialOrder1 , PolynomialOrder2 ,
  PolynomialOrder3 , ThinPlateSpline , Projective , 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 QgsGcpTransformerInterfaceclone () 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...
 
QgsGcpTransformerInterfaceoperator= (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 QgsGcpTransformerInterfacecreate (TransformMethod method)
 Creates a new QgsGcpTransformerInterface subclass representing the specified transform method. More...
 
static QgsGcpTransformerInterfacecreateFromParameters (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...
 

Detailed Description

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.

Since
QGIS 3.20

Definition at line 33 of file qgsgcptransformer.h.

Member Enumeration Documentation

◆ TransformMethod

Available transformation methods.

Enumerator
Linear 

Linear transform.

Helmert 

Helmert transform.

PolynomialOrder1 

Polynomial order 1.

PolynomialOrder2 

Polyonmial order 2.

PolynomialOrder3 

Polynomial order.

ThinPlateSpline 

Thin plate splines.

Projective 

Projective.

InvalidTransform 

Invalid transform.

Definition at line 42 of file qgsgcptransformer.h.

Constructor & Destructor Documentation

◆ QgsGcpTransformerInterface() [1/2]

QgsGcpTransformerInterface::QgsGcpTransformerInterface ( )
default

Constructor for QgsGcpTransformerInterface.

◆ ~QgsGcpTransformerInterface()

virtual QgsGcpTransformerInterface::~QgsGcpTransformerInterface ( )
virtualdefault

◆ QgsGcpTransformerInterface() [2/2]

QgsGcpTransformerInterface::QgsGcpTransformerInterface ( const QgsGcpTransformerInterface other)
delete

QgsGcpTransformerInterface cannot be copied - use clone() instead.

Member Function Documentation

◆ clone()

virtual QgsGcpTransformerInterface * QgsGcpTransformerInterface::clone ( ) const
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.

◆ create()

QgsGcpTransformerInterface * QgsGcpTransformerInterface::create ( QgsGcpTransformerInterface::TransformMethod  method)
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.

◆ createFromParameters()

QgsGcpTransformerInterface * QgsGcpTransformerInterface::createFromParameters ( QgsGcpTransformerInterface::TransformMethod  method,
const QVector< QgsPointXY > &  sourceCoordinates,
const QVector< QgsPointXY > &  destinationCoordinates 
)
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.

◆ GDALTransformer()

virtual GDALTransformerFunc QgsGcpTransformerInterface::GDALTransformer ( ) const
pure virtual

Returns function pointer to the GDALTransformer function.

Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.

◆ GDALTransformerArgs()

virtual void * QgsGcpTransformerInterface::GDALTransformerArgs ( ) const
pure virtual

Returns pointer to the GDALTransformer arguments.

Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.

◆ method()

virtual TransformMethod QgsGcpTransformerInterface::method ( ) const
pure virtual

◆ methodToString()

QString QgsGcpTransformerInterface::methodToString ( QgsGcpTransformerInterface::TransformMethod  method)
static

Returns a translated string representing the specified transform method.

Definition at line 47 of file qgsgcptransformer.cpp.

◆ minimumGcpCount()

virtual int QgsGcpTransformerInterface::minimumGcpCount ( ) const
pure virtual

Returns the minimum number of Ground Control Points (GCPs) required for parameter fitting.

Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.

◆ operator=()

QgsGcpTransformerInterface & QgsGcpTransformerInterface::operator= ( const QgsGcpTransformerInterface other)
delete

QgsGcpTransformerInterface cannot be copied - use clone() instead.

◆ transform()

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.

Returns
true if transformation was successful.

Definition at line 29 of file qgsgcptransformer.cpp.

◆ updateParametersFromGcps()

virtual bool QgsGcpTransformerInterface::updateParametersFromGcps ( const QVector< QgsPointXY > &  sourceCoordinates,
const QVector< QgsPointXY > &  destinationCoordinates,
bool  invertYAxis = false 
)
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.

Returns
true on success, false on failure

Implemented in QgsLinearGeorefTransform, QgsHelmertGeorefTransform, QgsGDALGeorefTransform, and QgsProjectiveGeorefTransform.


The documentation for this class was generated from the following files: