QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsdatumtransform.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdatumtransform.h
3  ------------------------
4  begin : Dec 2017
5  copyright : (C) 2017 Nyall Dawson
6  email : nyall dot dawson at gmail dot com
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 #ifndef QGSDATUMTRANSFORM_H
18 #define QGSDATUMTRANSFORM_H
19 
20 #include "qgis_core.h"
21 #include <QString>
22 
24 
25 
35 class CORE_EXPORT QgsDatumTransform
36 {
37 
38  public:
39 
45  {
46 
51  TransformPair( int sourceTransformId = -1, int destinationTransformId = -1 )
52  : sourceTransformId( sourceTransformId )
53  , destinationTransformId( destinationTransformId )
54  {}
55 
60  int sourceTransformId = -1;
61 
66  int destinationTransformId = -1;
67 
69  {
70  return other.sourceTransformId == sourceTransformId && other.destinationTransformId == destinationTransformId;
71  }
72 
74  {
75  return other.sourceTransformId != sourceTransformId || other.destinationTransformId != destinationTransformId;
76  }
77 
78  };
79 
85  {
87  int datumTransformId = -1;
88 
90  int epsgCode = 0;
91 
93  QString sourceCrsAuthId;
94 
97 
100 
103 
105  QString remarks;
106 
108  QString scope;
109 
111  bool preferred = false;
112 
114  bool deprecated = false;
115 
116  };
117 
123  static QList< QgsDatumTransform::TransformPair > datumTransformations( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination );
124 
131  static QString datumTransformToProj( int datumTransformId );
132 
138  static int projStringToDatumTransformId( const QString &string );
139 
147  static QgsDatumTransform::TransformInfo datumTransformInfo( int datumTransformId );
148 
149  private:
150 
151  static void searchDatumTransform( const QString &sql, QList< int > &transforms );
152 
153 
154 };
155 
156 #endif // QGSDATUMTRANSFORM_H
QString destinationCrsDescription
Destination CRS description.
bool operator!=(QgsDatumTransform::TransformPair other) const
bool operator==(QgsDatumTransform::TransformPair other) const
QString sourceCrsDescription
Source CRS description.
Contains datum transform information.
int destinationTransformId
ID for the datum transform to use when projecting to the destination CRS.
QString destinationCrsAuthId
Destination CRS auth ID.
Contains methods and classes relating the datum transformations.
QString sourceCrsAuthId
Source CRS auth ID.
TransformPair(int sourceTransformId=-1, int destinationTransformId=-1)
Constructor for a TransformPair with the specified sourceTransformId and destinationTransformId trans...
Contains datum transform information.
This class represents a coordinate reference system (CRS).
QString remarks
Transform remarks.
int sourceTransformId
ID for the datum transform to use when projecting from the source CRS.
QString scope
Scope of transform.