Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add factory method which creates an initialized transformer from meth…
- Loading branch information
|
@@ -68,6 +68,16 @@ Returns a translated string representing the specified transform ``method``. |
|
|
%Docstring |
|
|
Creates a new QgsGcpTransformerInterface subclass representing the specified transform ``method``. |
|
|
|
|
|
Caller takes ownership of the returned object. |
|
|
%End |
|
|
|
|
|
static QgsGcpTransformerInterface *createFromParameters( TransformMethod method, const QVector<QgsPointXY> &mapCoordinates, const QVector<QgsPointXY> &pixelCoordinates ) /Factory/; |
|
|
%Docstring |
|
|
Creates a new QgsGcpTransformerInterface subclass representing the specified transform ``method``, initialized |
|
|
using the given lists of map and pixel coordinates. |
|
|
|
|
|
If the parameters cannot be fit to a transform ``None`` will be returned. |
|
|
|
|
|
Caller takes ownership of the returned object. |
|
|
%End |
|
|
|
|
|
|
@@ -72,6 +72,18 @@ QgsGcpTransformerInterface *QgsGcpTransformerInterface::create( QgsGcpTransforme |
|
|
} |
|
|
} |
|
|
|
|
|
QgsGcpTransformerInterface *QgsGcpTransformerInterface::createFromParameters( QgsGcpTransformerInterface::TransformMethod method, const QVector<QgsPointXY> &mapCoordinates, const QVector<QgsPointXY> &pixelCoordinates ) |
|
|
{ |
|
|
std::unique_ptr< QgsGcpTransformerInterface > transformer( create( method ) ); |
|
|
if ( !transformer ) |
|
|
return nullptr; |
|
|
|
|
|
if ( !transformer->updateParametersFromGcps( mapCoordinates, pixelCoordinates ) ) |
|
|
return nullptr; |
|
|
|
|
|
return transformer.release(); |
|
|
} |
|
|
|
|
|
|
|
|
// |
|
|
// QgsLinearGeorefTransform |
|
|
|
@@ -88,6 +88,16 @@ class ANALYSIS_EXPORT QgsGcpTransformerInterface SIP_ABSTRACT |
|
|
*/ |
|
|
static QgsGcpTransformerInterface *create( TransformMethod method ) SIP_FACTORY; |
|
|
|
|
|
/** |
|
|
* Creates a new QgsGcpTransformerInterface subclass representing the specified transform \a method, initialized |
|
|
* using the given lists of map and pixel coordinates. |
|
|
* |
|
|
* If the parameters cannot be fit to a transform NULLPTR will be returned. |
|
|
* |
|
|
* Caller takes ownership of the returned object. |
|
|
*/ |
|
|
static QgsGcpTransformerInterface *createFromParameters( TransformMethod method, const QVector<QgsPointXY> &mapCoordinates, const QVector<QgsPointXY> &pixelCoordinates ) SIP_FACTORY; |
|
|
|
|
|
#ifndef SIP_RUN |
|
|
|
|
|
/** |
|
|