QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgscoordinatereferencesystemregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscoordinatereferencesystemregistry.h
3 -------------------
4 begin : January 2021
5 copyright : (C) 2021 by 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
18#ifndef QGSCOORDINATEREFERENCESYSTEMREGISTRY_H
19#define QGSCOORDINATEREFERENCESYSTEMREGISTRY_H
20
21#include <QObject>
22#include <QMap>
23#include <QSet>
25
28
29
30#ifndef SIP_RUN
31
41struct CORE_EXPORT QgsCrsDbRecord
42{
43 QString description;
45 QString srsId;
46 QString authName;
47 QString authId;
49 bool deprecated = false;
50};
51#endif
52
64class CORE_EXPORT QgsCoordinateReferenceSystemRegistry : public QObject
65{
66 Q_OBJECT
67 public:
68
72 explicit QgsCoordinateReferenceSystemRegistry( QObject *parent = nullptr );
73
75
82 {
83 public:
84
86 long id = -1;
87
89 QString name;
90
92 QString proj;
93
98 QString wkt;
99
102 };
103
108 QList< QgsCoordinateReferenceSystemRegistry::UserCrsDetails > userCrsList() const;
109
124 long addUserCrs( const QgsCoordinateReferenceSystem &crs, const QString &name, Qgis::CrsDefinitionFormat nativeFormat = Qgis::CrsDefinitionFormat::Wkt );
125
142 bool updateUserCrs( long id, const QgsCoordinateReferenceSystem &crs, const QString &name, Qgis::CrsDefinitionFormat nativeFormat = Qgis::CrsDefinitionFormat::Wkt );
143
151 bool removeUserCrs( long id );
152
160 QMap< QString, QgsProjOperation > projOperations() const;
161
171 QList< QgsCelestialBody > celestialBodies() const;
172
180 QSet< QString > authorities() const;
181
188 QList< QgsCrsDbRecord > crsDbRecords() const SIP_SKIP;
189
190 signals:
191
204 void userCrsChanged( const QString &id );
205
214 void userCrsAdded( const QString &id );
215
222 void userCrsRemoved( long id );
223
228 void crsDefinitionsChanged();
229
230 private:
231
232 bool insertProjection( const QString &projectionAcronym );
233
234 mutable QList< QgsCelestialBody > mCelestialBodies;
235 mutable QMap< QString, QgsProjOperation > mProjOperations;
236 mutable QSet< QString > mKnownAuthorities;
237 mutable QList< QgsCrsDbRecord > mCrsDbRecords;
238
239};
240
241
242#endif // QGSCOORDINATEREFERENCESYSTEMREGISTRY_H
CrsType
Data provider flags.
Definition qgis.h:1696
@ Unknown
Unknown type.
CrsDefinitionFormat
CRS definition formats.
Definition qgis.h:2617
@ Wkt
WKT format (always recommended over proj string format)
Contains information about a celestial body.
QgsCoordinateReferenceSystem crs
QgsCoordinateReferenceSystem object representing the user-defined CRS.
A registry for known coordinate reference system (CRS) definitions, including any user-defined CRSes.
This class represents a coordinate reference system (CRS).
Contains information about a PROJ operation.
#define SIP_SKIP
Definition qgis_sip.h:126
const QgsCoordinateReferenceSystem & crs