QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 "qgsrectangle.h"
23 #include <QString>
24 #include <QList>
25 
27 
28 #ifndef SIP_RUN
29 struct PJconsts;
30 typedef struct PJconsts PJ;
31 #endif
32 
42 class CORE_EXPORT QgsDatumTransform
43 {
44 
45  public:
46 
53  {
54 
59  TransformPair( int sourceTransformId = -1, int destinationTransformId = -1 )
60  : sourceTransformId( sourceTransformId )
61  , destinationTransformId( destinationTransformId )
62  {}
63 
68  int sourceTransformId = -1;
69 
74  int destinationTransformId = -1;
75 
76  // TODO c++20 - replace with = default
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 scope;
160 
162  QString remarks;
163 
165  QString areaOfUse;
166 
168  QString authority;
169 
171  QString code;
172  };
173 
181  {
183  QString proj;
185  QString name;
187  double accuracy = 0;
188 
195  QString authority;
196 
203  QString code;
204 
211  QString scope;
212 
219  QString remarks;
220 
227  bool isAvailable = false;
228 
237  QString areaOfUse;
238 
244 
248  QList< QgsDatumTransform::GridDetails > grids;
249 
256  QList< QgsDatumTransform::SingleOperationDetails > operationDetails;
257  };
258 
278  static QList< QgsDatumTransform::TransformDetails > operations( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination, bool includeSuperseded = false );
279 
287  Q_DECL_DEPRECATED static QList< QgsDatumTransform::TransformPair > datumTransformations( const QgsCoordinateReferenceSystem &source, const QgsCoordinateReferenceSystem &destination ) SIP_DEPRECATED;
288 
297  Q_DECL_DEPRECATED static QString datumTransformToProj( int datumTransformId ) SIP_DEPRECATED;
298 
306  Q_DECL_DEPRECATED static int projStringToDatumTransformId( const QString &string ) SIP_DEPRECATED;
307 
317  Q_DECL_DEPRECATED static QgsDatumTransform::TransformInfo datumTransformInfo( int datumTransformId ) SIP_DEPRECATED;
318 
319 #ifndef SIP_RUN
320 
327  static QgsDatumTransform::TransformDetails transformDetailsFromPj( PJ *op );
328 #endif
329 
330  private:
331 
332  static void searchDatumTransform( const QString &sql, QList< int > &transforms );
333 
334 
335 };
336 
337 #endif // QGSDATUMTRANSFORM_H
QgsDatumTransform::SingleOperationDetails::scope
QString scope
Scope of operation, from EPSG registry database.
Definition: qgsdatumtransform.h:159
QgsDatumTransform::SingleOperationDetails::code
QString code
Authority code, e.g. "8447" (for EPSG:8447).
Definition: qgsdatumtransform.h:171
QgsDatumTransform::TransformInfo::destinationCrsDescription
QString destinationCrsDescription
Destination CRS description.
Definition: qgsdatumtransform.h:111
QgsDatumTransform::TransformPair::operator==
bool operator==(QgsDatumTransform::TransformPair other) const
Definition: qgsdatumtransform.h:77
QgsDatumTransform::SingleOperationDetails::remarks
QString remarks
Remarks for operation, from EPSG registry database.
Definition: qgsdatumtransform.h:162
QgsDatumTransform::SingleOperationDetails
Contains information about a single coordinate operation.
Definition: qgsdatumtransform.h:156
qgsrectangle.h
QgsDatumTransform::TransformPair
Contains datum transform information.
Definition: qgsdatumtransform.h:52
QgsDatumTransform::TransformDetails::areaOfUse
QString areaOfUse
Area of use string.
Definition: qgsdatumtransform.h:237
QgsDatumTransform::TransformDetails::operationDetails
QList< QgsDatumTransform::SingleOperationDetails > operationDetails
Contains information about the single operation steps used in the transform operation.
Definition: qgsdatumtransform.h:256
QgsDatumTransform::TransformDetails::scope
QString scope
Scope of operation, from EPSG registry database.
Definition: qgsdatumtransform.h:211
QgsDatumTransform::TransformInfo::sourceCrsAuthId
QString sourceCrsAuthId
Source CRS auth ID.
Definition: qgsdatumtransform.h:102
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsDatumTransform::GridDetails
Contains information about a projection transformation grid file.
Definition: qgsdatumtransform.h:132
QgsDatumTransform::TransformPair::sourceTransformId
int sourceTransformId
ID for the datum transform to use when projecting from the source CRS.
Definition: qgsdatumtransform.h:68
QgsDatumTransform::TransformPair::destinationTransformId
int destinationTransformId
ID for the datum transform to use when projecting to the destination CRS.
Definition: qgsdatumtransform.h:74
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsDatumTransform::TransformDetails::grids
QList< QgsDatumTransform::GridDetails > grids
Contains a list of transform grids used by the operation.
Definition: qgsdatumtransform.h:248
QgsDatumTransform::GridDetails::url
QString url
Url to download grid from.
Definition: qgsdatumtransform.h:141
QgsDatumTransform::TransformPair::TransformPair
TransformPair(int sourceTransformId=-1, int destinationTransformId=-1)
Constructor for a TransformPair with the specified sourceTransformId and destinationTransformId trans...
Definition: qgsdatumtransform.h:59
QgsDatumTransform
Contains methods and classes relating the datum transformations.
Definition: qgsdatumtransform.h:42
QgsDatumTransform::TransformDetails::authority
QString authority
Authority name, e.g.
Definition: qgsdatumtransform.h:195
QgsDatumTransform::TransformInfo::remarks
QString remarks
Transform remarks.
Definition: qgsdatumtransform.h:114
qgis_sip.h
QgsDatumTransform::GridDetails::fullName
QString fullName
Full name of transform grid.
Definition: qgsdatumtransform.h:137
QgsDatumTransform::TransformInfo::sourceCrsDescription
QString sourceCrsDescription
Source CRS description.
Definition: qgsdatumtransform.h:108
QgsDatumTransform::GridDetails::shortName
QString shortName
Short name of transform grid.
Definition: qgsdatumtransform.h:135
QgsDatumTransform::TransformDetails::remarks
QString remarks
Remarks for operation, from EPSG registry database.
Definition: qgsdatumtransform.h:219
QgsDatumTransform::TransformDetails
Contains information about a coordinate transformation operation.
Definition: qgsdatumtransform.h:180
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsDatumTransform::TransformInfo::destinationCrsAuthId
QString destinationCrsAuthId
Destination CRS auth ID.
Definition: qgsdatumtransform.h:105
QgsDatumTransform::TransformDetails::name
QString name
Display name of transform operation.
Definition: qgsdatumtransform.h:185
QgsDatumTransform::TransformDetails::bounds
QgsRectangle bounds
Valid bounds for the coordinate operation.
Definition: qgsdatumtransform.h:243
QgsDatumTransform::TransformInfo
Contains datum transform information.
Definition: qgsdatumtransform.h:93
QgsDatumTransform::GridDetails::packageName
QString packageName
Name of package the grid is included within.
Definition: qgsdatumtransform.h:139
QgsDatumTransform::SingleOperationDetails::authority
QString authority
Authority name, e.g. EPSG.
Definition: qgsdatumtransform.h:168
QgsDatumTransform::SingleOperationDetails::areaOfUse
QString areaOfUse
Area of use, from EPSG registry database.
Definition: qgsdatumtransform.h:165
QgsDatumTransform::TransformPair::operator!=
bool operator!=(QgsDatumTransform::TransformPair other) const
Definition: qgsdatumtransform.h:82
QgsDatumTransform::TransformDetails::proj
QString proj
Proj representation of transform operation.
Definition: qgsdatumtransform.h:183
QgsDatumTransform::TransformInfo::scope
QString scope
Scope of transform.
Definition: qgsdatumtransform.h:117
QgsDatumTransform::TransformDetails::code
QString code
Identification code, e.g.
Definition: qgsdatumtransform.h:203
PJ
struct PJconsts PJ
Definition: qgscoordinatereferencesystem.h:49