/
qgscoordinatetransformcontext.sip.in
195 lines (128 loc) · 6.06 KB
/
qgscoordinatetransformcontext.sip.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinatetransformcontext.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsCoordinateTransformContext
{
%Docstring
Contains information about the context in which a coordinate transform is executed.
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().
.. note::
QgsCoordinateTransformContext objects are thread safe for read and write.
.. note::
QgsCoordinateTransformContext objects are implicitly shared.
.. seealso:: :py:class:`QgsDatumTransform`
.. seealso:: :py:class:`QgsCoordinateTransform`
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgscoordinatetransformcontext.h"
%End
public:
QgsCoordinateTransformContext();
%Docstring
Constructor for QgsCoordinateTransformContext.
%End
~QgsCoordinateTransformContext();
QgsCoordinateTransformContext( const QgsCoordinateTransformContext &rhs );
%Docstring
Copy constructor
%End
bool operator==( const QgsCoordinateTransformContext &rhs ) const;
void clear();
%Docstring
Clears all stored transform information from the context.
%End
QMap< QPair< QString, QString>, QgsDatumTransform::TransformPair > sourceDestinationDatumTransforms() const;
%Docstring
Returns the stored mapping for source to destination CRS pairs to associated datum transforms to use.
The map keys will be :py:func:`QgsCoordinateReferenceSystems.authid()`s.
If either the source transform ID or destination transform ID is -1, then no datum transform is
required for transformations for that source or destination.
.. 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:: :py:func:`addSourceDestinationDatumTransform`
%End
bool addSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
const QgsCoordinateReferenceSystem &destinationCrs,
int sourceTransformId,
int destinationTransformId );
%Docstring
Adds a new ``sourceTransform`` and ``destinationTransform`` to use when projecting coordinates
from the specified ``sourceCrs`` to the specified ``destinationCrs``.
If either ``sourceTransformId`` or ``destinationTransformId`` is -1, then no datum transform is
required for transformations for that source or destination.
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:: :py:func:`sourceDestinationDatumTransforms`
.. seealso:: :py:func:`removeSourceDestinationDatumTransform`
%End
void removeSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
const QgsCoordinateReferenceSystem &destinationCrs );
%Docstring
Removes the source to destination datum transform pair for the specified ``sourceCrs`` and
``destinationCrs``.
.. seealso:: :py:func:`addSourceDestinationDatumTransform`
%End
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.
.. note::
source and destination are reversible.
%End
QgsDatumTransform::TransformPair calculateDatumTransforms( const QgsCoordinateReferenceSystem &source,
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.
Returns an ID of -1 if a datum transform should not be used for the source or
destination.
.. note::
source and destination are reversible.
%End
bool readXml( const QDomElement &element, const QgsReadWriteContext &context, QStringList &missingTransforms /Out/ );
%Docstring
Reads the context's state from a DOM ``element``.
Returns false if transforms stored in the XML are not available. In this case ``missingTransforms`` will be
filled with missing datum transform strings.
.. seealso:: :py:func:`writeXml`
%End
void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
%Docstring
Writes the context's state to a DOM ``element``.
.. seealso:: :py:func:`readXml`
%End
void readSettings();
%Docstring
Reads the context's state from application settings.
.. seealso:: :py:func:`readSettings`
%End
void writeSettings();
%Docstring
Write the context's state to application settings.
.. seealso:: :py:func:`writeSettings`
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinatetransformcontext.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/