Skip to content

Commit 86d9492

Browse files
committedDec 15, 2017
Remove context-unaware QgsCoordinateTransform constructors from Python bindings
This forces Python code and plugins to become datum transform aware, and given that upgrading python code is easy (just add QgsProject.instance() as a new argument to the constructor) it's relatively painless to force this on PyQGIS users. Also fix upgrade the easy QgsCoordinateTransform c++ constructors where the project is available, or where using QgsProject::instance() is safe to do. For others, just avoid the deprecated warnings until we can get access to the correct project instance where the transform is being constructed.
1 parent 91e0afb commit 86d9492

File tree

80 files changed

+208
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+208
-88
lines changed
 

‎doc/api_break.dox

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,11 +914,12 @@ called if changes are made to the CRS database.
914914
QgsCoordinateTransform {#qgis_api_break_3_0_QgsCoordinateTransform}
915915
----------------------
916916

917-
- QgsCoordinateTransform is no longer a QObject. readXml, writeXml and initialize are all normal public members now,
917+
- QgsCoordinateTransform is no longer a QObject. Initialize is a normal public members now,
918918
not slots. The invalidTransformInput() signal has been removed.
919919
- The extra QgsCoordinateTransform constructors (those not taking QgsCoordinateReferenceSystem arguments) have been
920920
removed. Now, QgsCoordinateTransform must be created using an already existing source and destination
921-
QgsCoordinateReferenceSystem object.
921+
QgsCoordinateReferenceSystem object, and either a QgsCoordinateTransformContext object or a reference to the
922+
current project instance.
922923
- QgsCoordinateTransform::clone() has been removed. Just use direct copies instead.
923924
- sourceCrs() and destCrs() now return a copy instead of a reference to the CRS. This has no effect on PyQGIS code, but c++
924925
plugins calling these methods will need to be updated.

‎python/core/qgscoordinatetransform.sip

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ class QgsCoordinateTransform
4545
Default constructor, creates an invalid QgsCoordinateTransform.
4646
%End
4747

48-
explicit QgsCoordinateTransform( const QgsCoordinateReferenceSystem &source,
49-
const QgsCoordinateReferenceSystem &destination );
50-
%Docstring
51-
Constructs a QgsCoordinateTransform using QgsCoordinateReferenceSystem objects.
52-
\param source source CRS, typically of the layer's coordinate system
53-
\param destination CRS, typically of the map canvas coordinate system
54-
%End
5548

5649
explicit QgsCoordinateTransform( const QgsCoordinateReferenceSystem &source,
5750
const QgsCoordinateReferenceSystem &destination,

0 commit comments

Comments
 (0)
Please sign in to comment.