QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
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>
24
27
39class CORE_EXPORT QgsCoordinateReferenceSystemRegistry : public QObject
40{
41 Q_OBJECT
42 public:
43
47 explicit QgsCoordinateReferenceSystemRegistry( QObject *parent = nullptr );
48
50
57 {
58 public:
59
61 long id = -1;
62
64 QString name;
65
67 QString proj;
68
73 QString wkt;
74
77 };
78
83 QList< QgsCoordinateReferenceSystemRegistry::UserCrsDetails > userCrsList() const;
84
99 long addUserCrs( const QgsCoordinateReferenceSystem &crs, const QString &name, Qgis::CrsDefinitionFormat nativeFormat = Qgis::CrsDefinitionFormat::Wkt );
100
117 bool updateUserCrs( long id, const QgsCoordinateReferenceSystem &crs, const QString &name, Qgis::CrsDefinitionFormat nativeFormat = Qgis::CrsDefinitionFormat::Wkt );
118
126 bool removeUserCrs( long id );
127
135 QMap< QString, QgsProjOperation > projOperations() const;
136
146 QList< QgsCelestialBody > celestialBodies() const;
147
148 signals:
149
162 void userCrsChanged( const QString &id );
163
172 void userCrsAdded( const QString &id );
173
180 void userCrsRemoved( long id );
181
187
188 private:
189
190 bool insertProjection( const QString &projectionAcronym );
191
192 mutable QList< QgsCelestialBody > mCelestialBodies;
193 mutable QMap< QString, QgsProjOperation > mProjOperations;
194
195};
196
197
198#endif // QGSCOORDINATEREFERENCESYSTEMREGISTRY_H
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1857
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.
void userCrsAdded(const QString &id)
Emitted whenever a new user CRS definition is added.
void userCrsChanged(const QString &id)
Emitted whenever an existing user CRS definition is changed.
void userCrsRemoved(long id)
Emitted when the user CRS with matching id is removed from the database.
void crsDefinitionsChanged()
Emitted whenever an operation has caused any of the known CRS definitions (including user-defined CRS...
This class represents a coordinate reference system (CRS).
Contains information about a PROJ operation.
const QgsCoordinateReferenceSystem & crs