QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 
25 class QgsCelestialBody;
26 class QgsProjOperation;
27 
39 class 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 
186  void crsDefinitionsChanged();
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
Qgis::CrsDefinitionFormat
CrsDefinitionFormat
CRS definition formats.
Definition: qgis.h:1687
QgsCoordinateReferenceSystemRegistry::UserCrsDetails::wkt
QString wkt
WKT definition of CRS.
Definition: qgscoordinatereferencesystemregistry.h:73
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsCoordinateReferenceSystemRegistry
A registry for known coordinate reference system (CRS) definitions, including any user-defined CRSes.
Definition: qgscoordinatereferencesystemregistry.h:39
QgsCelestialBody
Contains information about a celestial body.
Definition: qgscelestialbody.h:31
QgsProjOperation
Contains information about a PROJ operation.
Definition: qgsprojoperation.h:30
QgsCoordinateReferenceSystemRegistry::UserCrsDetails::crs
QgsCoordinateReferenceSystem crs
QgsCoordinateReferenceSystem object representing the user-defined CRS.
Definition: qgscoordinatereferencesystemregistry.h:76
QgsCoordinateReferenceSystemRegistry::UserCrsDetails
Contains details of a custom (user defined) CRS.
Definition: qgscoordinatereferencesystemregistry.h:56
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsCoordinateReferenceSystemRegistry::UserCrsDetails::proj
QString proj
PROJ string definition of CRS.
Definition: qgscoordinatereferencesystemregistry.h:67
QgsCoordinateReferenceSystemRegistry::UserCrsDetails::name
QString name
CRS name (or description)
Definition: qgscoordinatereferencesystemregistry.h:64
qgscoordinatereferencesystem.h