QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsdatums.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdatums.h
3 ------------------------
4 begin : May 2021
5 copyright : (C) 2021 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 QGSDATUMS_H
18#define QGSDATUMS_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
22#include "qgsrectangle.h"
23#include <QString>
24#include <QList>
25
26
34class CORE_EXPORT QgsDatumEnsembleMember
35{
36 public:
37
41 QString name() const { return mName; }
42
46 QString scope() const { return mScope; }
47
51 QString remarks() const { return mRemarks; }
52
56 QString authority() const { return mAuthority; }
57
61 QString code() const { return mCode; }
62
63#ifdef SIP_RUN
64 SIP_PYOBJECT __repr__();
65 % MethodCode
66 QString id;
67 if ( !sipCpp->code().isEmpty() )
68 id = QStringLiteral( "%1 (%2:%3)" ).arg( sipCpp->name(), sipCpp->authority(), sipCpp->code() );
69 else
70 id = sipCpp->name();
71 QString str = QStringLiteral( "<QgsDatumEnsembleMember: %1>" ).arg( id );
72 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
73 % End
74#endif
75
76 private:
77
78 QString mName;
79 QString mScope;
80 QString mRemarks;
81 QString mAuthority;
82 QString mCode;
83
85};
86
94class CORE_EXPORT QgsDatumEnsemble
95{
96 public:
97
102 bool isValid() const { return mValid; }
103
107 QString name() const { return mName; }
108
112 double accuracy() const { return mAccuracy; }
113
117 QString authority() const { return mAuthority; }
118
122 QString code() const { return mCode; }
123
127 QString scope() const { return mScope; }
128
132 QString remarks() const { return mRemarks; }
133
137 QList< QgsDatumEnsembleMember > members() const { return mMembers; }
138
139#ifdef SIP_RUN
140 SIP_PYOBJECT __repr__();
141 % MethodCode
142 QString str;
143 if ( !sipCpp->isValid() )
144 {
145 str = QStringLiteral( "<QgsDatumEnsemble: invalid>" );
146 }
147 else
148 {
149 QString id;
150 if ( !sipCpp->code().isEmpty() )
151 id = QStringLiteral( "%1 (%2:%3)" ).arg( sipCpp->name(), sipCpp->authority(), sipCpp->code() );
152 else
153 id = sipCpp->name();
154 str = QStringLiteral( "<QgsDatumEnsemble: %1>" ).arg( id );
155 }
156 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
157 % End
158#endif
159
160 private:
161
162 bool mValid = false;
163 QString mName;
164 double mAccuracy = 0;
165 QString mAuthority;
166 QString mCode;
167 QString mScope;
168 QString mRemarks;
169 QList< QgsDatumEnsembleMember > mMembers;
170
172};
173
174#endif // QGSDATUMS_H
This class represents a coordinate reference system (CRS).
Contains information about a member of a datum ensemble.
Definition qgsdatums.h:35
QString authority() const
Authority name, e.g.
Definition qgsdatums.h:56
QString scope() const
Returns the scope of operation, from EPSG registry database.
Definition qgsdatums.h:46
QString remarks() const
Remarks for operation, from EPSG registry database.
Definition qgsdatums.h:51
QString name() const
Returns the name of the member.
Definition qgsdatums.h:41
QString code() const
Authority code, e.g.
Definition qgsdatums.h:61
Contains information about a datum ensemble.
Definition qgsdatums.h:95
QString code() const
Identification code, e.g.
Definition qgsdatums.h:122
QString authority() const
Authority name, e.g.
Definition qgsdatums.h:117
QString scope() const
Scope of ensemble, from EPSG registry database.
Definition qgsdatums.h:127
bool isValid() const
Returns true if the datum ensemble is a valid object, or false if it is a null/invalid object.
Definition qgsdatums.h:102
QList< QgsDatumEnsembleMember > members() const
Contains a list of members of the ensemble.
Definition qgsdatums.h:137
QString name() const
Display name of datum ensemble.
Definition qgsdatums.h:107
QString remarks() const
Remarks for ensemble, from EPSG registry database.
Definition qgsdatums.h:132
double accuracy() const
Positional accuracy (in meters).
Definition qgsdatums.h:112
#define str(x)
Definition qgis.cpp:39