QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
qgscoordinatetransformcontext.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscoordinatetransformcontext.h
3 -------------------------------
4 begin : November 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSCOORDINATETRANSFORMCONTEXT_H
19#define QGSCOORDINATETRANSFORMCONTEXT_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgsdatumtransform.h"
24
25#include <QMetaType>
26#include <QExplicitlySharedDataPointer>
29class QgsCoordinateTransformContextPrivate;
30class QDomElement;
31
32/***************************************************************************
33 * This class is considered CRITICAL and any change MUST be accompanied with
34 * full unit tests in testqgsfeature.cpp.
35 * See details in QEP #17
36 ****************************************************************************/
37
57{
58 public:
59
64
66
71
76
77 bool operator==( const QgsCoordinateTransformContext &rhs ) const ;
78
82 void clear();
83
99 Q_DECL_DEPRECATED QMap< QPair< QString, QString>, QgsDatumTransform::TransformPair > sourceDestinationDatumTransforms() const SIP_DEPRECATED;
100
116 QMap< QPair< QString, QString>, QString > coordinateOperations() const;
117
132 Q_DECL_DEPRECATED bool addSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, int sourceTransformId, int destinationTransformId ) SIP_DEPRECATED;
133
165 bool addCoordinateOperation( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &coordinateOperationProjString, bool allowFallback = true );
166
174 Q_DECL_DEPRECATED void removeSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs ) SIP_DEPRECATED ;
175
181 void removeCoordinateOperation( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs );
182
188 bool hasTransform( const QgsCoordinateReferenceSystem &source,
189 const QgsCoordinateReferenceSystem &destination ) const;
190
201 Q_DECL_DEPRECATED QgsDatumTransform::TransformPair calculateDatumTransforms( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination ) const SIP_DEPRECATED;
202
222 QString calculateCoordinateOperation( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination ) const;
223
233 bool allowFallbackTransform( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination ) const;
234
241 bool mustReverseCoordinateOperation( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination ) const;
242
243 // TODO QGIS 4.0 - remove missingTransforms, not used for Proj >= 6.0 builds
244
253 bool readXml( const QDomElement &element, const QgsReadWriteContext &context, QStringList &missingTransforms SIP_OUT );
254
259 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
260
261
266 void readSettings();
267
272 void writeSettings();
273
274
275 private:
276
277 QExplicitlySharedDataPointer<QgsCoordinateTransformContextPrivate> d;
278
279};
280
282
283#endif // QGSCOORDINATETRANSFORMCONTEXT_H
284
285
286
287
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Contains methods and classes relating the datum transformations.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_OUT
Definition qgis_sip.h:58
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Contains datum transform information.