QGIS API Documentation  2.99.0-Master (0a63d1f)
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 
51  QgsCoordinateTransform transformation( QgsMapLayer* layer ) const;
52 
53  void readXml( const QDomNode& parentNode );
54 
55  void writeXml( QDomNode& parentNode, QDomDocument& theDoc ) const;
56 
57  struct Entry
58  {
59  QString srcAuthId;
60  QString destAuthId;
61  int srcDatumTransform; //-1 if unknown or not specified
63  };
64 
65  protected:
67 
69  QHash< QString, Entry > mEntries;
70 };
71 
72 #endif // QGSDATUMTRANSFORMSTORE_H
Base class for all map layer types.
Definition: qgsmaplayer.h:50
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