Skip to content

Commit

Permalink
Fix another test under proj6
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 13, 2019
1 parent da92b3f commit cf95f14
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/src/python/test_qgsvectorlayer.py
Expand Up @@ -3354,6 +3354,8 @@ def setUp(self):
super(TestQgsVectorLayerTransformContext, self).setUp()
self.ctx = QgsCoordinateTransformContext()
self.ctx.addSourceDestinationDatumTransform(QgsCoordinateReferenceSystem(4326), QgsCoordinateReferenceSystem(3857), 1234, 1235)
self.ctx.addCoordinateOperation(QgsCoordinateReferenceSystem(4326),
QgsCoordinateReferenceSystem(3857), 'test')

This comment has been minimized.

Copy link
@strk

strk Feb 3, 2020

Contributor

@nyalldawson is the previous like (3356) still needed at all ? Shouldn't addCoordinateOperation completely replace addSourceDestinationDatumTransform ?

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Feb 3, 2020

Author Collaborator

Depends on the proj library version. You could potentially if this out for proj < 6

This comment has been minimized.

Copy link
@strk

strk Feb 3, 2020

Contributor

The header file containing the definition of addSourceDestinationDatumTransform says that such signature is deprecated adn to look at addCoordinateOperation instead. If it depends on PROJ version then the deprecation notice is wrong. I would expect the new signature to behave correctly for all PROJ version, is that wrong ?

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Feb 3, 2020

Author Collaborator

The dox explain it all. The new methods only work with proj 6 (and cannot possibly be made to work with proj <6). Proj < 6 is support is deprecated, and will be removed in qgis 4 (or earlier), hence the older methods are deprecated and only left for compatibility.


def testTransformContextIsSetInCtor(self):
"""Test transform context can be set from ctor"""
Expand Down

0 comments on commit cf95f14

Please sign in to comment.