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;
52 static int projVersionMajor();
60 static QStringList searchPaths();
67 FlagMatchBoundCrsToUnderlyingSourceCrs = 1 << 0,
69 Q_DECLARE_FLAGS( IdentifyFlags, IdentifyFlag )
71 #if PROJ_VERSION_MAJOR >= 6
82 void CORE_EXPORT operator()( PJ *
object );
89 using proj_pj_unique_ptr = std::unique_ptr< PJ, ProjPJDeleter >;
95 static bool usesAngularUnit(
const QString &projDef );
103 static bool axisOrderIsSwapped(
const PJ *
crs );
109 static proj_pj_unique_ptr crsToSingleCrs(
const PJ *
crs );
117 static bool identifyCrs(
const PJ *
crs, QString &authName, QString &authCode, IdentifyFlags flags = IdentifyFlags() );
122 static bool coordinateOperationIsAvailable(
const QString &projDef );
127 static QList< QgsDatumTransform::GridDetails > gridsUsed(
const QString &proj );
136 static QStringList nonAvailableGrids(
const QString &projDef );
144 #if PROJ_VERSION_MAJOR>=8
147 #elif PROJ_VERSION_MAJOR>=6
180 #if defined(USE_THREAD_LOCAL) && !defined(Q_OS_WIN)
183 static QThreadStorage< QgsProjContext * > sProjContext;
Used to create and store a proj context object, correctly freeing the context upon destruction.
Utility functions for working with the proj library.
IdentifyFlag
Flags controlling CRS identification behavior.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
const QgsCoordinateReferenceSystem & crs