QGIS API Documentation  2.99.0-Master (13a3f2f)
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 
33 class CORE_EXPORT QgsDatumTransformStore
34 {
35  public:
36  explicit QgsDatumTransformStore( const QgsCoordinateReferenceSystem &destCrs );
37 
38  void clear();
39 
40  void setDestinationCrs( const QgsCoordinateReferenceSystem &destCrs );
41 
42  void addEntry( const QString &layerId, const QString &srcAuthId, const QString &destAuthId, int srcDatumTransform, int destDatumTransform );
43 
44  bool hasEntryForLayer( QgsMapLayer *layer ) const;
45 
52  QgsCoordinateTransform transformation( const QgsMapLayer *layer ) const;
53 
54  void readXml( const QDomNode &parentNode );
55 
56  void writeXml( QDomNode &parentNode, QDomDocument &doc ) const;
57 
58  struct CORE_EXPORT Entry
59  {
60  QString srcAuthId;
61  QString destAuthId;
62  int srcDatumTransform; //-1 if unknown or not specified
64  };
65 
66  protected:
68 
70  QHash< QString, Entry > mEntries;
71 };
72 
73 #endif // QGSDATUMTRANSFORMSTORE_H
Base class for all map layer types.
Definition: qgsmaplayer.h:54
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