QGIS API Documentation  3.5.0-Master (5b7f808)
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.h"
23 #include "qgsdatumtransform.h"
24 
27 class QgsCoordinateTransformContextPrivate;
28 class QDomElement;
29 
30 /***************************************************************************
31  * This class is considered CRITICAL and any change MUST be accompanied with
32  * full unit tests in testqgsfeature.cpp.
33  * See details in QEP #17
34  ****************************************************************************/
35 
63 {
64  public:
65 
70 
72 
77 
82 
83  bool operator==( const QgsCoordinateTransformContext &rhs ) const ;
84 
88  void clear();
89 
90 
91 #if 0
92 //singlesourcedest
93 
108  QMap<QString, int> sourceDatumTransforms() const;
109 
126  bool addSourceDatumTransform( const QgsCoordinateReferenceSystem &crs, int transform );
127 
133  void removeSourceDatumTransform( const QgsCoordinateReferenceSystem &crs );
134 
149  QMap< QString, int > destinationDatumTransforms() const;
150 
167  bool addDestinationDatumTransform( const QgsCoordinateReferenceSystem &crs, int transform );
168 
174  void removeDestinationDatumTransform( const QgsCoordinateReferenceSystem &crs );
175 
176 #endif
177 
191  QMap< QPair< QString, QString>, QgsDatumTransform::TransformPair > sourceDestinationDatumTransforms() const;
192 
208  bool addSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
209  const QgsCoordinateReferenceSystem &destinationCrs,
210  int sourceTransformId,
211  int destinationTransformId );
212 
218  void removeSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
219  const QgsCoordinateReferenceSystem &destinationCrs );
220 
226  bool hasTransform( const QgsCoordinateReferenceSystem &source,
227  const QgsCoordinateReferenceSystem &destination ) const;
228 
238  QgsDatumTransform::TransformPair calculateDatumTransforms( const QgsCoordinateReferenceSystem &source,
239  const QgsCoordinateReferenceSystem &destination ) const;
240 
249  bool readXml( const QDomElement &element, const QgsReadWriteContext &context, QStringList &missingTransforms SIP_OUT );
250 
255  void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
256 
257 
262  void readSettings();
263 
268  void writeSettings();
269 
270 
271  private:
272 
273  QExplicitlySharedDataPointer<QgsCoordinateTransformContextPrivate> d;
274 
275 };
276 
277 #endif // QGSCOORDINATETRANSFORMCONTEXT_H
278 
279 
280 
281 
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
#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).