QGIS API Documentation  2.99.0-Master (19b062c)
qgscrscache.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscrscache.h
3  --------------
4  begin : September 6th, 2011
5  copyright : (C) 2011 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
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 QGSCRSCACHE_H
19 #define QGSCRSCACHE_H
20 
21 #include "qgis_core.h"
23 #include <QHash>
24 #include <QReadWriteLock>
25 
27 
32 class CORE_EXPORT QgsCoordinateTransformCache
33 {
34  public:
35  static QgsCoordinateTransformCache *instance();
36 
40  QgsCoordinateTransformCache &operator=( const QgsCoordinateTransformCache &rh ) = delete;
41 
50  QgsCoordinateTransform transform( const QString &srcAuthId, const QString &destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );
51 
53  void invalidateCrs( const QString &crsAuthId );
54 
55  private:
56  QMultiHash< QPair< QString, QString >, QgsCoordinateTransform > mTransforms; //same auth_id pairs might have different datum transformations
57 
58  QgsCoordinateTransformCache() = default;
59 
60 #ifdef SIP_RUN
62 #endif
63 
64 };
65 
66 #endif // QGSCRSCACHE_H
Class for doing transforms between two map coordinate systems.
Cache coordinate transform by authid of source/dest transformation to avoid the overhead of initializ...
Definition: qgscrscache.h:32