@@ -84,6 +84,16 @@ class CORE_EXPORT QgsCoordinateTransform
84
84
* will be applied, and is used for calculating necessary datum transforms
85
85
* to utilize.
86
86
*
87
+ * Python scripts should generally use the constructor variant which accepts
88
+ * a QgsProject instance instead of this constructor.
89
+ *
90
+ * \warning Do NOT use an empty/default constructed QgsCoordinateTransformContext()
91
+ * object when creating QgsCoordinateTransform objects. This prevents correct
92
+ * datum transform handling and may result in inaccurate transformations. Always
93
+ * ensure that the QgsCoordinateTransformContext object is correctly retrieved
94
+ * based on the current code context, or use the constructor variant which
95
+ * accepts a QgsProject argument instead.
96
+ *
87
97
* \since QGIS 3.0
88
98
*/
89
99
explicit QgsCoordinateTransform ( const QgsCoordinateReferenceSystem &source,
@@ -98,6 +108,16 @@ class CORE_EXPORT QgsCoordinateTransform
98
108
* No reference to \a project is stored or utilized outside of the constructor,
99
109
* and it is used to retrieve the project's transform context only.
100
110
*
111
+ * Python scripts should utilise the QgsProject.instance() project
112
+ * instance when creating QgsCoordinateTransform. This will ensure
113
+ * that any datum transforms defined in the project will be
114
+ * correctly respected during coordinate transforms. E.g.
115
+ *
116
+ * \code{.py}
117
+ * transform = QgsCoordinateTransform(QgsCoordinateReferenceSystem("EPSG:3111"),
118
+ * QgsCoordinateReferenceSystem("EPSG:4326"), QgsProject.instance())
119
+ * \endcode
120
+ *
101
121
* \since QGIS 3.0
102
122
*/
103
123
explicit QgsCoordinateTransform ( const QgsCoordinateReferenceSystem &source,
0 commit comments