17 #ifndef QGSPROJUTILS_H
18 #define QGSPROJUTILS_H
22 #include "qgis_core.h"
23 #include "qgsconfig.h"
26 #include <QStringList>
28 #if !defined(USE_THREAD_LOCAL) || defined(Q_OS_WIN)
29 #include <QThreadStorage>
32 #if PROJ_VERSION_MAJOR>=6
35 typedef struct PJconsts PJ;
54 return PROJ_VERSION_MAJOR;
63 static QStringList searchPaths();
70 FlagMatchBoundCrsToUnderlyingSourceCrs = 1 << 0,
72 Q_DECLARE_FLAGS( IdentifyFlags, IdentifyFlag )
74 #if PROJ_VERSION_MAJOR >= 6
85 void CORE_EXPORT operator()( PJ *
object );
92 using proj_pj_unique_ptr = std::unique_ptr< PJ, ProjPJDeleter >;
98 static bool usesAngularUnit(
const QString &projDef );
106 static bool axisOrderIsSwapped(
const PJ *
crs );
112 static proj_pj_unique_ptr crsToSingleCrs(
const PJ *
crs );
120 static bool identifyCrs(
const PJ *
crs, QString &authName, QString &authCode, IdentifyFlags flags = IdentifyFlags() );
125 static bool coordinateOperationIsAvailable(
const QString &projDef );
130 static QList< QgsDatumTransform::GridDetails > gridsUsed(
const QString &proj );
133 #if 0 // not possible in current Proj 6 API
139 static QStringList nonAvailableGrids(
const QString &projDef );
147 #if PROJ_VERSION_MAJOR>=6
180 #if defined(USE_THREAD_LOCAL) && !defined(Q_OS_WIN)
183 static QThreadStorage< QgsProjContext * > sProjContext;
187 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProjUtils::IdentifyFlags )
189 #endif // QGSPROJUTILS_H