QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgscoordinatereferencesystem_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscoordinatereferencesystem_p.h
3 
4  --------------------------------
5  begin : 2016
6  copyright : (C) 2016 by Nyall Dawson
7  email : nyall dot dawson at gmail dot com
8 ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 #ifndef QGSCOORDINATEREFERENCESYSTEM_PRIVATE_H
19 #define QGSCOORDINATEREFERENCESYSTEM_PRIVATE_H
20 
22 
23 //
24 // W A R N I N G
25 // -------------
26 //
27 // This file is not part of the QGIS API. It exists purely as an
28 // implementation detail. This header file may change from version to
29 // version without notice, or even be removed.
30 //
31 
33 #include <ogr_srs_api.h>
34 
35 #ifdef DEBUG
36 typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH;
37 #else
38 typedef void *OGRSpatialReferenceH;
39 #endif
40 
41 class QgsCoordinateReferenceSystemPrivate : public QSharedData
42 {
43  public:
44 
45  explicit QgsCoordinateReferenceSystemPrivate()
46  : mSrsId( 0 )
47  , mIsGeographic( false )
48  , mMapUnits( QGis::UnknownUnit )
49  , mSRID( 0 )
50  , mIsValid( 0 )
51  , mCRS( OSRNewSpatialReference( nullptr ) )
52  , mAxisInvertedDirty( false )
53  , mAxisInverted( false )
54  {
55  }
56 
57  QgsCoordinateReferenceSystemPrivate( const QgsCoordinateReferenceSystemPrivate& other )
58  : QSharedData( other )
59  , mSrsId( other.mSrsId )
60  , mDescription( other.mDescription )
61  , mProjectionAcronym( other.mProjectionAcronym )
62  , mEllipsoidAcronym( other.mEllipsoidAcronym )
63  , mIsGeographic( other.mIsGeographic )
64  , mMapUnits( other.mMapUnits )
65  , mSRID( other.mSRID )
66  , mAuthId( other.mAuthId )
67  , mIsValid( other.mIsValid )
68  , mCRS( nullptr )
69  , mValidationHint( other.mValidationHint )
70  , mWkt( other.mWkt )
71  , mProj4( other.mProj4 )
72  , mAxisInvertedDirty( other.mAxisInvertedDirty )
73  , mAxisInverted( other.mAxisInverted )
74  {
75  if ( mIsValid )
76  {
77  mCRS = OSRClone( other.mCRS );
78  }
79  else
80  {
81  mCRS = OSRNewSpatialReference( nullptr );
82  }
83  }
84 
85  ~QgsCoordinateReferenceSystemPrivate()
86  {
87  OSRDestroySpatialReference( mCRS );
88  }
89 
91  long mSrsId;
92 
94  QString mDescription;
95 
97  QString mProjectionAcronym;
98 
100  QString mEllipsoidAcronym;
101 
103  bool mIsGeographic;
104 
106  QGis::UnitType mMapUnits;
107 
109  long mSRID;
110 
112  QString mAuthId;
113 
115  bool mIsValid;
116 
118 
119  QString mValidationHint;
120  mutable QString mWkt;
121  mutable QString mProj4;
122 
124  mutable bool mAxisInvertedDirty;
125 
127  mutable bool mAxisInverted;
128 
129 };
130 
132 
133 #endif //QGSCOORDINATEREFERENCESYSTEM_PRIVATE_H
The QGis class provides global constants for use throughout the application.
Definition: qgis.h:40
UnitType
Map units that qgis supports.
Definition: qgis.h:159
void * OGRSpatialReferenceH