QGIS API Documentation  2.99.0-Master (f1c3692)
qgsdatumtransformstore.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdatumtransformstore.h
3  ---------------------
4  begin : June 2014
5  copyright : (C) 2014 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSDATUMTRANSFORMSTORE_H
16 #define QGSDATUMTRANSFORMSTORE_H
17 
18 #include "qgis_core.h"
20 
22 class QgsMapLayer;
23 
24 class QDomElement;
25 
26 
34 class CORE_EXPORT QgsDatumTransformStore
35 {
36  public:
37  explicit QgsDatumTransformStore( const QgsCoordinateReferenceSystem &destCrs );
38 
39  void clear();
40 
41  void setDestinationCrs( const QgsCoordinateReferenceSystem &destCrs );
42 
43  void addEntry( const QString &layerId, const QString &srcAuthId, const QString &destAuthId, int srcDatumTransform, int destDatumTransform );
44 
45  bool hasEntryForLayer( QgsMapLayer *layer ) const;
46 
55  QgsCoordinateTransform transformation( const QgsMapLayer *layer, QString srcAuthId = QString(), QString dstAuthId = QString() ) const;
56 
57  void readXml( const QDomNode &parentNode );
58 
59  void writeXml( QDomNode &parentNode, QDomDocument &doc ) const;
60 
61  struct CORE_EXPORT Entry
62  {
63  QString srcAuthId;
64  QString destAuthId;
65  int srcDatumTransform; //-1 if unknown or not specified
67  };
68 
69  protected:
71 
73  QHash< QString, Entry > mEntries;
74 };
75 
76 #endif // QGSDATUMTRANSFORMSTORE_H
Base class for all map layer types.
Definition: qgsmaplayer.h:56
QgsCoordinateReferenceSystem mDestCRS
The QgsDatumTransformStore class keeps track of datum transformations as chosen by the user...
This class represents a coordinate reference system (CRS).
Class for doing transforms between two map coordinate systems.
QHash< QString, Entry > mEntries
key = layer ID