QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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 "qgis_sip.h"
22 #include <QString>
23 #include <QList>
24 
26 
27 #if PROJ_VERSION_MAJOR>=6
28 #ifndef SIP_RUN
29 struct PJconsts;
30 typedef struct PJconsts PJ;
31 #endif
32 #endif
33 
43 class CORE_EXPORT QgsDatumTransform
44 {
45 
46  public:
47 
54  {
55 
60  TransformPair( int sourceTransformId = -1, int destinationTransformId = -1 )
61  : sourceTransformId( sourceTransformId )
62  , destinationTransformId( destinationTransformId )
63  {}
64 
69  int sourceTransformId = -1;
70 
75  int destinationTransformId = -1;
76 
78  {
79  return other.sourceTransformId == sourceTransformId && other.destinationTransformId == destinationTransformId;
80  }
81 
83  {
84  return other.sourceTransformId != sourceTransformId || other.destinationTransformId != destinationTransformId;
85  }
86 
87  };
88 
94  {
96  int datumTransformId = -1;
97 
99  int epsgCode = 0;
100 
103 
106 
109 
112 
114  QString remarks;
115 
117  QString scope;
118 
120  bool preferred = false;
121 
123  bool deprecated = false;
124 
125  };
126 
127 
132  struct GridDetails
133  {
135  QString shortName;
137  QString fullName;
139  QString packageName;
141  QString url;
143  bool directDownload = false;
145  bool openLicense = false;
147  bool isAvailable = false;
148  };
149 
157  {
159  QString proj;
161  QString name;
163  double accuracy = 0;
164 
171  bool isAvailable = false;
172 
176  QList< QgsDatumTransform::GridDetails > grids;
177  };
178 
195  static QList< QgsDatumTransform::TransformDetails > operations( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination );
196 
204  Q_DECL_DEPRECATED static QList< QgsDatumTransform::TransformPair > datumTransformations( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination ) SIP_DEPRECATED;
205 
214  Q_DECL_DEPRECATED static QString datumTransformToProj( int datumTransformId ) SIP_DEPRECATED;
215 
223  Q_DECL_DEPRECATED static int projStringToDatumTransformId( const QString &string ) SIP_DEPRECATED;
224 
234  Q_DECL_DEPRECATED static QgsDatumTransform::TransformInfo datumTransformInfo( int datumTransformId ) SIP_DEPRECATED;
235 
236 #ifndef SIP_RUN
237 #if PROJ_VERSION_MAJOR >= 6
238 
245  static QgsDatumTransform::TransformDetails transformDetailsFromPj( PJ *op );
246 #endif
247 #endif
248 
249  private:
250 
251  static void searchDatumTransform( const QString &sql, QList< int > &transforms );
252 
253 
254 };
255 
256 #endif // QGSDATUMTRANSFORM_H
QString name
Display name of transform operation.
QString destinationCrsDescription
Destination CRS description.
bool operator!=(QgsDatumTransform::TransformPair other) const
bool operator==(QgsDatumTransform::TransformPair other) const
Contains information about a projection transformation grid file.
QString packageName
Name of package the grid is included within.
QString fullName
Full name of transform grid.
QString shortName
Short name of transform grid.
QString sourceCrsDescription
Source CRS description.
QString url
Url to download grid from.
Contains datum transform information.
int destinationTransformId
ID for the datum transform to use when projecting to the destination CRS.
#define SIP_DEPRECATED
Definition: qgis_sip.h:99
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.
QList< QgsDatumTransform::GridDetails > grids
Contains a list of transform grids used by the operation.
This class represents a coordinate reference system (CRS).
QString remarks
Transform remarks.
Contains information about a coordinate transformation operation.
QString proj
Proj representation of transform operation.
int sourceTransformId
ID for the datum transform to use when projecting from the source CRS.
QString scope
Scope of transform.