QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
19 
21 class QgsMapLayer;
22 
23 class QDomElement;
24 
25 
32 class CORE_EXPORT QgsDatumTransformStore
33 {
34  public:
35  explicit QgsDatumTransformStore( const QgsCoordinateReferenceSystem& destCrs );
36 
37  void clear();
38 
39  void setDestinationCrs( const QgsCoordinateReferenceSystem& destCrs );
40 
41  void addEntry( const QString& layerId, const QString& srcAuthId, const QString& destAuthId, int srcDatumTransform, int destDatumTransform );
42 
43  bool hasEntryForLayer( QgsMapLayer* layer ) const;
44 
49  const QgsCoordinateTransform* transformation( QgsMapLayer* layer ) const;
50 
51  void readXML( const QDomNode& parentNode );
52 
53  void writeXML( QDomNode& parentNode, QDomDocument& theDoc ) const;
54 
55  struct Entry
56  {
57  QString srcAuthId;
58  QString destAuthId;
59  int srcDatumTransform; //-1 if unknown or not specified
61  };
62 
63  protected:
65 
67  QHash< QString, Entry > mEntries;
68 };
69 
70 #endif // QGSDATUMTRANSFORMSTORE_H
Base class for all map layer types.
Definition: qgsmaplayer.h:48
int srcDatumTransform
Definition: qgsdatumtransformstore.h:59
QString destAuthId
Definition: qgsdatumtransformstore.h:58
Definition: qgsdatumtransformstore.h:55
int destDatumTransform
Definition: qgsdatumtransformstore.h:60
QString srcAuthId
Definition: qgsdatumtransformstore.h:57
QgsCoordinateReferenceSystem mDestCRS
Definition: qgsdatumtransformstore.h:64
The QgsDatumTransformStore class keeps track of datum transformations as chosen by the user...
Definition: qgsdatumtransformstore.h:32
Class for storing a coordinate reference system (CRS)
Definition: qgscoordinatereferencesystem.h:50
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:52
QHash< QString, Entry > mEntries
key = layer ID
Definition: qgsdatumtransformstore.h:67