17 #ifndef QGSCOORDINATETRANSFORM_H 18 #define QGSCOORDINATETRANSFORM_H 20 #include <QExplicitlySharedDataPointer> 22 #include "qgsconfig.h" 23 #include "qgis_core.h" 28 class QgsCoordinateTransformPrivate;
124 int sourceDatumTransformId,
125 int destinationDatumTransformId );
144 bool isValid()
const;
241 void transformInPlace(
double &x,
double &y,
double &z,
TransformDirection direction = ForwardTransform ) const
SIP_THROW( QgsCsException );
269 void transformInPlace(
float &x,
float &y,
float &z,
TransformDirection direction = ForwardTransform ) const SIP_SKIP;
283 void transformInPlace( QVector<
float> &x, QVector<
float> &y, QVector<
float> &z,
298 void transformInPlace( QVector<
double> &x, QVector<
double> &y, QVector<
double> &z,
328 void transformCoords(
int numPoint,
double *x,
double *y,
double *z,
TransformDirection direction = ForwardTransform ) const
SIP_THROW( QgsCsException );
333 bool isShortCircuited() const;
345 QString coordinateOperation() const;
360 void setCoordinateOperation( const QString &operation ) const;
375 Q_DECL_DEPRECATED
int sourceDatumTransformId() const
SIP_DEPRECATED;
390 Q_DECL_DEPRECATED
void setSourceDatumTransformId(
int datumId ) SIP_DEPRECATED;
405 Q_DECL_DEPRECATED
int destinationDatumTransformId() const SIP_DEPRECATED;
420 Q_DECL_DEPRECATED
void setDestinationDatumTransformId(
int datumId ) SIP_DEPRECATED;
434 static void invalidateCache(
bool disableCache =
false );
444 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
456 double scaleFactor(
const QgsRectangle &referenceExtent )
const;
459 SIP_PYOBJECT __repr__();
461 QString str = QStringLiteral(
"<QgsCoordinateTransform: %1 to %2>" ).arg( sipCpp->sourceCrs().isValid() ? sipCpp->sourceCrs().authid() : QStringLiteral(
"NULL" ),
462 sipCpp->destinationCrs().isValid() ? sipCpp->destinationCrs().authid() : QStringLiteral(
"NULL" ) );
463 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
520 const QString &error )> &handler );
540 #if PROJ_VERSION_MAJOR>=6 545 static void removeFromCacheObjectsBelongingToCurrentThread(
void *pj_context );
550 mutable QExplicitlySharedDataPointer<QgsCoordinateTransformPrivate> d;
556 bool mHasContext =
false;
559 #if PROJ_VERSION_MAJOR>=6 562 const QString &coordinateOperationProj );
566 int srcDatumTransform,
567 int destDatumTransform );
572 static QReadWriteLock sCacheLock;
574 static bool sDisableCache;
582 QString mySummary( QStringLiteral(
"\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ) );
583 mySummary += QLatin1String(
"\n\tInitialized? : " );
599 mySummary +=
"\n\tShort Circuit? : ";
609 mySummary +=
"\n\tSource Spatial Ref Sys : ";
616 mySummary +=
"Undefined";
619 mySummary +=
"\n\tDest Spatial Ref Sys : ";
622 mySummary << r.destCRS();
626 mySummary +=
"Undefined";
630 mySummary += QLatin1String(
"\nCoordinate Transform def ends \n%%%%%%%%%%%%%%%%%%%%%%%%\n" );
631 return os << mySummary.toLocal8Bit().data() << std::endl;
636 #endif // QGSCOORDINATETRANSFORM_H A rectangle specified with double values.
A class to represent a 2D point.
const QgsCoordinateReferenceSystem & crs
Used to create and store a proj context object, correctly freeing the context upon destruction...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Contains information about the context in which a coordinate transform is executed.
This class represents a coordinate reference system (CRS).
Custom exception class for Coordinate Reference System related exceptions.