QGIS API Documentation  3.0.2-Girona (307d082)
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  : mCRS( OSRNewSpatialReference( nullptr ) )
47  {
48  }
49 
50  QgsCoordinateReferenceSystemPrivate( const QgsCoordinateReferenceSystemPrivate &other )
51  : QSharedData( other )
52  , mSrsId( other.mSrsId )
53  , mDescription( other.mDescription )
54  , mProjectionAcronym( other.mProjectionAcronym )
55  , mEllipsoidAcronym( other.mEllipsoidAcronym )
56  , mIsGeographic( other.mIsGeographic )
57  , mMapUnits( other.mMapUnits )
58  , mSRID( other.mSRID )
59  , mAuthId( other.mAuthId )
60  , mIsValid( other.mIsValid )
61  , mCRS( nullptr )
62  , mValidationHint( other.mValidationHint )
63  , mWkt( other.mWkt )
64  , mProj4( other.mProj4 )
65  , mAxisInvertedDirty( other.mAxisInvertedDirty )
66  , mAxisInverted( other.mAxisInverted )
67  {
68  if ( mIsValid )
69  {
70  mCRS = OSRClone( other.mCRS );
71  }
72  else
73  {
74  mCRS = OSRNewSpatialReference( nullptr );
75  }
76  }
77 
78  ~QgsCoordinateReferenceSystemPrivate()
79  {
80  OSRDestroySpatialReference( mCRS );
81  }
82 
84  long mSrsId = 0;
85 
87  QString mDescription;
88 
90  QString mProjectionAcronym;
91 
93  QString mEllipsoidAcronym;
94 
96  bool mIsGeographic = false;
97 
100 
102  long mSRID = 0;
103 
105  QString mAuthId;
106 
108  bool mIsValid = 0;
109 
111 
112  QString mValidationHint;
113  mutable QString mWkt;
114  mutable QString mProj4;
115 
117  mutable bool mAxisInvertedDirty = false;
118 
120  mutable bool mAxisInverted = false;
121 
122 };
123 
125 
126 #endif //QGSCOORDINATEREFERENCESYSTEM_PRIVATE_H
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:43
Unknown distance unit.
Definition: qgsunittypes.h:54
void * OGRSpatialReferenceH