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;
213 QgsPointXY transform(
double x,
double y, TransformDirection direction = ForwardTransform )
const;
241 void transformInPlace(
double &x,
double &y,
double &z, TransformDirection direction = ForwardTransform ) const
SIP_THROW(
QgsCsException );
255 void transformInPlace(
float &x,
float &y,
double &z, TransformDirection direction = ForwardTransform ) const
SIP_SKIP;
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,
284 TransformDirection direction = ForwardTransform ) const
SIP_SKIP;
298 void transformInPlace( QVector<
double> &x, QVector<
double> &y, QVector<
double> &z,
299 TransformDirection direction = ForwardTransform ) const
SIP_SKIP;
306 void transformPolygon( QPolygonF &polygon, TransformDirection direction = ForwardTransform ) const
SIP_THROW(
QgsCsException );
328 void transformCoords(
int numPoint,
double *x,
double *y,
double *z, TransformDirection direction = ForwardTransform ) const
SIP_THROW(
QgsCsException );
333 bool isShortCircuited() const;
351 QString coordinateOperation() const;
366 QgsDatumTransform::TransformDetails instantiatedCoordinateOperationDetails() const;
381 void setCoordinateOperation( const QString &operation ) const;
397 void setAllowFallbackTransforms(
bool allowed );
410 bool allowFallbackTransforms() const;
443 void setBallparkTransformsAreAppropriate(
bool appropriate );
459 void disableFallbackOperationHandler(
bool disabled );
469 bool fallbackOperationOccurred() const;
484 Q_DECL_DEPRECATED
int sourceDatumTransformId() const
SIP_DEPRECATED;
499 Q_DECL_DEPRECATED
void setSourceDatumTransformId(
int datumId )
SIP_DEPRECATED;
514 Q_DECL_DEPRECATED
int destinationDatumTransformId() const
SIP_DEPRECATED;
529 Q_DECL_DEPRECATED
void setDestinationDatumTransformId(
int datumId )
SIP_DEPRECATED;
543 static void invalidateCache(
bool disableCache =
false );
553 static void invalidateCache(
bool disableCache
SIP_PYARGREMOVE =
false );
565 double scaleFactor(
const QgsRectangle &referenceExtent )
const;
568 SIP_PYOBJECT __repr__();
570 QString str = QStringLiteral(
"<QgsCoordinateTransform: %1 to %2>" ).arg( sipCpp->sourceCrs().isValid() ? sipCpp->sourceCrs().authid() : QStringLiteral(
"NULL" ),
571 sipCpp->destinationCrs().isValid() ? sipCpp->destinationCrs().authid() : QStringLiteral(
"NULL" ) );
572 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
629 const QString &error )> &handler );
656 const QString &desiredOperation )> &handler );
661 #if PROJ_VERSION_MAJOR>=6
666 static void removeFromCacheObjectsBelongingToCurrentThread(
void *pj_context );
671 mutable QExplicitlySharedDataPointer<QgsCoordinateTransformPrivate> d;
677 bool mHasContext =
false;
680 mutable QString mLastError;
681 bool mBallparkTransformsAreAppropriate =
false;
682 bool mDisableFallbackHandler =
false;
683 mutable bool mFallbackOperationOccurred =
false;
685 #if PROJ_VERSION_MAJOR>=6
688 const QString &coordinateOperationProj,
bool allowFallback );
692 int srcDatumTransform,
693 int destDatumTransform );
698 static QReadWriteLock sCacheLock;
700 static bool sDisableCache;
705 const QString &desiredOperation )> sFallbackOperationOccurredHandler;
713 QString mySummary( QStringLiteral(
"\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ) );
714 mySummary += QLatin1String(
"\n\tInitialized? : " );
730 mySummary +=
"\n\tShort Circuit? : ";
740 mySummary +=
"\n\tSource Spatial Ref Sys : ";
747 mySummary +=
"Undefined";
750 mySummary +=
"\n\tDest Spatial Ref Sys : ";
753 mySummary << r.destCRS();
757 mySummary +=
"Undefined";
761 mySummary += QLatin1String(
"\nCoordinate Transform def ends \n%%%%%%%%%%%%%%%%%%%%%%%%\n" );
762 return os << mySummary.toLocal8Bit().data() << std::endl;
767 #endif // QGSCOORDINATETRANSFORM_H