QGIS API Documentation  3.3.0-Master (77eafc0)
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 
87  void clear();
88 
89 
90 #if 0
91 //singlesourcedest
92 
107  QMap<QString, int> sourceDatumTransforms() const;
108 
125  bool addSourceDatumTransform( const QgsCoordinateReferenceSystem &crs, int transform );
126 
132  void removeSourceDatumTransform( const QgsCoordinateReferenceSystem &crs );
133 
148  QMap< QString, int > destinationDatumTransforms() const;
149 
166  bool addDestinationDatumTransform( const QgsCoordinateReferenceSystem &crs, int transform );
167 
173  void removeDestinationDatumTransform( const QgsCoordinateReferenceSystem &crs );
174 
175 #endif
176 
190  QMap< QPair< QString, QString>, QgsDatumTransform::TransformPair > sourceDestinationDatumTransforms() const;
191 
207  bool addSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
208  const QgsCoordinateReferenceSystem &destinationCrs,
209  int sourceTransformId,
210  int destinationTransformId );
211 
217  void removeSourceDestinationDatumTransform( const QgsCoordinateReferenceSystem &sourceCrs,
218  const QgsCoordinateReferenceSystem &destinationCrs );
219 
225  bool hasTransform( const QgsCoordinateReferenceSystem &source,
226  const QgsCoordinateReferenceSystem &destination ) const;
227 
237  QgsDatumTransform::TransformPair calculateDatumTransforms( const QgsCoordinateReferenceSystem &source,
238  const QgsCoordinateReferenceSystem &destination ) const;
239 
248  bool readXml( const QDomElement &element, const QgsReadWriteContext &context, QStringList &missingTransforms SIP_OUT );
249 
254  void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
255 
256 
261  void readSettings();
262 
267  void writeSettings();
268 
269 
270  private:
271 
272  QExplicitlySharedDataPointer<QgsCoordinateTransformContextPrivate> d;
273 
274 };
275 
276 #endif // QGSCOORDINATETRANSFORMCONTEXT_H
277 
278 
279 
280 
The class is used as a container of context for various read/write operations on other objects...
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).