2017-11-05 16:56:24 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgscoordinatetransformcontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-05 17:36:59 +10:00
|
|
|
|
2017-11-05 19:59:01 +10:00
|
|
|
|
2017-11-28 22:04:43 -04:00
|
|
|
|
2017-11-05 16:56:24 +10:00
|
|
|
class QgsCoordinateTransformContext
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Contains information about the context in which a coordinate transform is executed.
|
|
|
|
|
2017-11-05 17:04:29 +10:00
|
|
|
The context stores various information regarding which coordinate transforms should
|
|
|
|
be used when transforming points from a source to destination coordinate reference
|
|
|
|
system.
|
|
|
|
|
|
|
|
The highest priority transforms are those set using addSourceDestinationDatumTransform()
|
|
|
|
and which the transform has a matching source to destination CRS pair.
|
|
|
|
|
|
|
|
Failing this, if the source CRS has a matching transform specified by
|
|
|
|
addSourceDatumTransform() then this datum transform will be used. The same logic
|
|
|
|
applies for destination CRS transforms set using addDestinationDatumTransform().
|
|
|
|
|
2017-11-05 17:48:01 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
QgsCoordinateTransformContext objects are thread safe for read and write.
|
|
|
|
|
2017-11-05 17:36:59 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
QgsCoordinateTransformContext objects are implicitly shared.
|
|
|
|
|
2017-11-05 16:56:24 +10:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscoordinatetransformcontext.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
QgsCoordinateTransformContext();
|
|
|
|
%Docstring
|
|
|
|
Constructor for QgsCoordinateTransformContext.
|
|
|
|
%End
|
|
|
|
|
2017-11-05 17:36:59 +10:00
|
|
|
QgsCoordinateTransformContext( const QgsCoordinateTransformContext &rhs );
|
|
|
|
%Docstring
|
|
|
|
Copy constructor
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-05 16:56:24 +10:00
|
|
|
void clear();
|
|
|
|
%Docstring
|
|
|
|
Clears all stored transform information from the context.
|
|
|
|
%End
|
|
|
|
|
2017-11-07 10:10:06 +10:00
|
|
|
|
|
|
|
|
2017-12-01 12:06:41 +10:00
|
|
|
QMap< QPair< QString, QString>, QgsCoordinateTransform::TransformPair > sourceDestinationDatumTransforms() const;
|
2017-11-05 16:56:24 +10:00
|
|
|
%Docstring
|
|
|
|
Returns the stored mapping for source to destination CRS pairs to associated datum transforms to use.
|
|
|
|
The map keys will be QgsCoordinateReferenceSystems.authid()s.
|
|
|
|
|
2017-12-01 12:06:41 +10:00
|
|
|
If either the source transform ID or destination transform ID is -1, then no datum transform is
|
2017-11-07 10:10:06 +10:00
|
|
|
required for transformations for that source or destination.
|
|
|
|
|
2017-11-05 16:56:24 +10:00
|
|
|
\warning This method should not be used to calculate the corresponding datum transforms
|
|
|
|
to use for a coordinate transform. Instead, always use calculateDatumTransforms()
|
|
|
|
to determine this.
|
|
|
|
|
|
|
|
.. seealso:: addSourceDestinationDatumTransform()
|
2017-12-01 12:06:41 +10:00
|
|
|
:rtype: QMap< QPair< str, QString>, QgsCoordinateTransform.TransformPair >
|
2017-11-05 16:56:24 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool addSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
|
|
|
|
const QgsCoordinateReferenceSystem &destinationCrs,
|
2017-12-01 12:06:41 +10:00
|
|
|
int sourceTransformId,
|
|
|
|
int destinationTransformId );
|
2017-11-05 16:56:24 +10:00
|
|
|
%Docstring
|
|
|
|
Adds a new ``sourceTransform`` and ``destinationTransform`` to use when projecting coordinates
|
|
|
|
from the the specified ``sourceCrs`` to the specified ``destinationCrs``.
|
|
|
|
|
2017-12-01 12:06:41 +10:00
|
|
|
If either ``sourceTransformId`` or ``destinationTransformId`` is -1, then no datum transform is
|
2017-11-07 10:10:06 +10:00
|
|
|
required for transformations for that source or destination.
|
2017-11-05 17:02:11 +10:00
|
|
|
|
2017-11-05 16:56:24 +10:00
|
|
|
Returns true if the new transform pair was added successfully.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Transforms set using this method will override any specific source or destination
|
|
|
|
transforms set by addSourceDatumTransform() or addDestinationDatumTransform().
|
|
|
|
|
|
|
|
.. seealso:: sourceDestinationDatumTransforms()
|
2017-11-07 10:10:06 +10:00
|
|
|
.. seealso:: removeSourceDestinationDatumTransform()
|
2017-11-05 16:56:24 +10:00
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
|
2017-11-07 10:10:06 +10:00
|
|
|
void removeSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
|
|
|
|
const QgsCoordinateReferenceSystem &destinationCrs );
|
|
|
|
%Docstring
|
|
|
|
Removes the source to destination datum transform pair for the specified ``sourceCrs`` and
|
|
|
|
``destinationCrs``.
|
|
|
|
.. seealso:: addSourceDestinationDatumTransform()
|
|
|
|
%End
|
|
|
|
|
2017-11-28 10:49:29 +10:00
|
|
|
bool hasTransform( const QgsCoordinateReferenceSystem &source,
|
|
|
|
const QgsCoordinateReferenceSystem &destination ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if the context has a valid datum transform to use
|
|
|
|
when transforming from the specified ``source`` CRS to ``destination`` CRS.
|
2017-11-28 08:19:51 -04:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
source and destination are reversible.
|
2017-11-28 10:49:29 +10:00
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
|
2017-12-01 12:06:41 +10:00
|
|
|
QgsCoordinateTransform::TransformPair calculateDatumTransforms( const QgsCoordinateReferenceSystem &source,
|
2017-11-05 16:56:24 +10:00
|
|
|
const QgsCoordinateReferenceSystem &destination ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the pair of source and destination datum transforms to use
|
|
|
|
for a transform from the specified ``source`` CRS to ``destination`` CRS.
|
|
|
|
|
2017-12-01 12:06:41 +10:00
|
|
|
Returns an ID of -1 if a datum transform should not be used for the source or
|
2017-11-05 16:56:24 +10:00
|
|
|
destination.
|
2017-11-28 08:19:51 -04:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
source and destination are reversible.
|
2017-12-01 12:06:41 +10:00
|
|
|
:rtype: QgsCoordinateTransform.TransformPair
|
2017-11-05 16:56:24 +10:00
|
|
|
%End
|
|
|
|
|
2017-11-05 19:59:01 +10:00
|
|
|
void readXml( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
|
|
|
|
%Docstring
|
|
|
|
Reads the context's state from a DOM ``element``.
|
|
|
|
.. seealso:: writeXml()
|
|
|
|
%End
|
|
|
|
|
|
|
|
void writeXml( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
|
|
|
|
%Docstring
|
|
|
|
Writes the context's state to a DOM ``element``.
|
|
|
|
.. seealso:: readXml()
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
2017-11-28 22:04:43 -04:00
|
|
|
void readSettings();
|
|
|
|
%Docstring
|
|
|
|
Reads the context's state from application settings.
|
|
|
|
.. seealso:: readSettings()
|
|
|
|
%End
|
|
|
|
|
|
|
|
void writeSettings();
|
|
|
|
%Docstring
|
|
|
|
Write the context's state to application settings.
|
|
|
|
.. seealso:: writeSettings()
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
2017-11-05 16:56:24 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgscoordinatetransformcontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|