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,
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 =
nullptr );
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 149 typedef struct projCtx_t PJ_CONTEXT;
171 static PJ_CONTEXT *
get();
174 PJ_CONTEXT *mContext =
nullptr;
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 static int projVersionMajor()
Returns the proj library major version number.
const QgsCoordinateReferenceSystem & crs
Used to create and store a proj context object, correctly freeing the context upon destruction...
IdentifyFlag
Flags controlling CRS identification behavior.
Utility functions for working with the proj library.