QGIS API Documentation  3.6.0-Noosa (5873452)
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>
29 class QgsCoordinateTransformContextPrivate;
30 class 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 
65 {
66  public:
67 
72 
74 
79 
84 
85  bool operator==( const QgsCoordinateTransformContext &rhs ) const ;
86 
90  void clear();
91 
92 
93 #if 0
94 //singlesourcedest
95 
110  QMap<QString, int> sourceDatumTransforms() const;
111 
128  bool addSourceDatumTransform( const QgsCoordinateReferenceSystem &crs, int transform );
129 
135  void removeSourceDatumTransform( const QgsCoordinateReferenceSystem &crs );
136 
151  QMap< QString, int > destinationDatumTransforms() const;
152 
169  bool addDestinationDatumTransform( const QgsCoordinateReferenceSystem &crs, int transform );
170 
176  void removeDestinationDatumTransform( const QgsCoordinateReferenceSystem &crs );
177 
178 #endif
179 
193  QMap< QPair< QString, QString>, QgsDatumTransform::TransformPair > sourceDestinationDatumTransforms() const;
194 
210  bool addSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
211  const QgsCoordinateReferenceSystem &destinationCrs,
212  int sourceTransformId,
213  int destinationTransformId );
214 
220  void removeSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
221  const QgsCoordinateReferenceSystem &destinationCrs );
222 
228  bool hasTransform( const QgsCoordinateReferenceSystem &source,
229  const QgsCoordinateReferenceSystem &destination ) const;
230 
240  QgsDatumTransform::TransformPair calculateDatumTransforms( const QgsCoordinateReferenceSystem &source,
241  const QgsCoordinateReferenceSystem &destination ) const;
242 
251  bool readXml( const QDomElement &element, const QgsReadWriteContext &context, QStringList &missingTransforms SIP_OUT );
252 
257  void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
258 
259 
264  void readSettings();
265 
270  void writeSettings();
271 
272 
273  private:
274 
275  QExplicitlySharedDataPointer<QgsCoordinateTransformContextPrivate> d;
276 
277 };
278 
280 
281 #endif // QGSCOORDINATETRANSFORMCONTEXT_H
282 
283 
284 
285 
The class is used as a container of context for various read/write operations on other objects...
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
const QgsCoordinateReferenceSystem & crs
Q_DECLARE_METATYPE(QModelIndex)
#define SIP_SKIP
Definition: qgis_sip.h:119
Contains information about the context in which a coordinate transform is executed.
Contains datum transform information.
#define SIP_OUT
Definition: qgis_sip.h:51
This class represents a coordinate reference system (CRS).