17 #ifndef QGSCOORDINATETRANSFORM_H
18 #define QGSCOORDINATETRANSFORM_H
20 #include <QExplicitlySharedDataPointer>
22 #include "qgsconfig.h"
23 #include "qgis_core.h"
28 class QgsCoordinateTransformPrivate;
130 int sourceDatumTransformId,
150 bool isValid()
const;
300 void transformInPlace( QVector<float> &x, QVector<float> &y, QVector<float> &z,
315 void transformInPlace( QVector<double> &x, QVector<double> &y, QVector<double> &z,
350 bool isShortCircuited()
const;
368 QString coordinateOperation()
const;
398 void setCoordinateOperation(
const QString &operation )
const;
414 void setAllowFallbackTransforms(
bool allowed );
427 bool allowFallbackTransforms()
const;
460 void setBallparkTransformsAreAppropriate(
bool appropriate );
476 void disableFallbackOperationHandler(
bool disabled );
486 bool fallbackOperationOccurred()
const;
501 Q_DECL_DEPRECATED
int sourceDatumTransformId()
const SIP_DEPRECATED;
516 Q_DECL_DEPRECATED
void setSourceDatumTransformId(
int datumId )
SIP_DEPRECATED;
531 Q_DECL_DEPRECATED
int destinationDatumTransformId()
const SIP_DEPRECATED;
546 Q_DECL_DEPRECATED
void setDestinationDatumTransformId(
int datumId )
SIP_DEPRECATED;
560 static void invalidateCache(
bool disableCache =
false );
570 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
582 double scaleFactor(
const QgsRectangle &referenceExtent )
const;
585 SIP_PYOBJECT __repr__();
587 QString
str = QStringLiteral(
"<QgsCoordinateTransform: %1 to %2>" ).arg( sipCpp->sourceCrs().isValid() ? sipCpp->sourceCrs().authid() : QStringLiteral(
"NULL" ),
588 sipCpp->destinationCrs().isValid() ? sipCpp->destinationCrs().authid() : QStringLiteral(
"NULL" ) );
589 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
646 const QString &error )> &handler );
673 const QString &desiredOperation )> &handler );
692 static void removeFromCacheObjectsBelongingToCurrentThread(
void *pj_context );
695 mutable QExplicitlySharedDataPointer<QgsCoordinateTransformPrivate> d;
701 bool mHasContext =
false;
704 mutable QString mLastError;
705 bool mBallparkTransformsAreAppropriate =
false;
706 bool mDisableFallbackHandler =
false;
707 mutable bool mFallbackOperationOccurred =
false;
711 const QString &coordinateOperationProj,
bool allowFallback );
716 static QReadWriteLock sCacheLock;
726 static bool sDisableCache;
731 const QString &desiredOperation )> sFallbackOperationOccurredHandler;
739 QString mySummary( QStringLiteral(
"\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ) );
740 mySummary += QLatin1String(
"\n\tInitialized? : " );
756 mySummary +=
"\n\tShort Circuit? : ";
766 mySummary +=
"\n\tSource Spatial Ref Sys : ";
773 mySummary +=
"Undefined";
776 mySummary +=
"\n\tDest Spatial Ref Sys : ";
779 mySummary << r.destCRS();
783 mySummary +=
"Undefined";
787 mySummary += QLatin1String(
"\nCoordinate Transform def ends \n%%%%%%%%%%%%%%%%%%%%%%%%\n" );
788 return os << mySummary.toLocal8Bit().data() << std::endl;
TransformDirection
Indicates the direction (forward or inverse) of a transform.
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Custom exception class for Coordinate Reference System related exceptions.
A class to represent a 2D point.
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,...
A rectangle specified with double values.
const QgsCoordinateReferenceSystem & crs