17 #ifndef QGSCOORDINATETRANSFORMPRIVATE_H
18 #define QGSCOORDINATETRANSFORMPRIVATE_H
21 #include "qgsconfig.h"
34 #include <QSharedData>
36 #if PROJ_VERSION_MAJOR<6
38 #ifndef USE_THREAD_LOCAL
39 #include <QThreadStorage>
41 typedef QPair< projPJ, projPJ > ProjData;
44 typedef struct PJconsts PJ;
51 #if PROJ_VERSION_MAJOR<6
53 typedef void *projCtx;
60 class QgsProjContextStore
64 QgsProjContextStore();
65 ~QgsProjContextStore();
67 projCtx get() {
return context; }
75 class QgsCoordinateTransformPrivate :
public QSharedData
80 explicit QgsCoordinateTransformPrivate();
88 int sourceDatumTransform,
89 int destDatumTransform );
91 QgsCoordinateTransformPrivate(
const QgsCoordinateTransformPrivate &other );
93 ~QgsCoordinateTransformPrivate();
103 ProjData threadLocalProjData();
105 #if PROJ_VERSION_MAJOR>=6
106 int mAvailableOpCount = -1;
107 ProjData threadLocalFallbackProjData();
110 bool removeObjectsBelongingToCurrentThread(
void *pj_context );
117 bool mIsValid =
false;
123 bool mShortCircuit =
false;
131 Q_DECL_DEPRECATED QString mSourceProjString;
132 Q_DECL_DEPRECATED QString mDestProjString;
134 Q_DECL_DEPRECATED
int mSourceDatumTransform = -1;
135 Q_DECL_DEPRECATED
int mDestinationDatumTransform = -1;
136 QString mProjCoordinateOperation;
137 bool mShouldReverseCoordinateOperation =
false;
138 bool mAllowFallbackTransforms =
true;
141 bool mIsReversed =
false;
143 #if PROJ_VERSION_MAJOR<6
149 #ifdef USE_THREAD_LOCAL
150 static thread_local QgsProjContextStore mProjContext;
152 static QThreadStorage< QgsProjContextStore * > mProjContext;
157 QReadWriteLock mProjLock;
158 QMap < uintptr_t, ProjData > mProjProjections;
159 QMap < uintptr_t, ProjData > mProjFallbackProjections;
197 const QString &error )> &handler );
212 #if PROJ_VERSION_MAJOR<6
213 Q_DECL_DEPRECATED QString stripDatumTransform(
const QString &proj4 )
const;
217 Q_DECL_DEPRECATED
void addNullGridShifts( QString &srcProjString, QString &destProjString,
int sourceDatumTransform,
int destinationDatumTransform )
const;
233 const QString &error )> sCoordinateOperationCreationErrorHandler;
239 QgsCoordinateTransformPrivate &operator= (
const QgsCoordinateTransformPrivate & ) =
delete;
244 #endif // QGSCOORDINATETRANSFORMPRIVATE_H