@@ -39,6 +39,14 @@ def testSourceDatumTransforms(self):
39
39
self .assertFalse (context .addSourceDatumTransform (QgsCoordinateReferenceSystem (), 4 ))
40
40
self .assertEqual (context .sourceDatumTransforms (), {'EPSG:3111' : 1 , 'EPSG:28356' : 3 })
41
41
42
+ # removing non-existing
43
+ self .assertTrue (context .addSourceDatumTransform (QgsCoordinateReferenceSystem (28357 ), - 1 ))
44
+ self .assertEqual (context .sourceDatumTransforms (), {'EPSG:3111' : 1 , 'EPSG:28356' : 3 })
45
+
46
+ # remove existing
47
+ self .assertTrue (context .addSourceDatumTransform (QgsCoordinateReferenceSystem (28356 ), - 1 ))
48
+ self .assertEqual (context .sourceDatumTransforms (), {'EPSG:3111' : 1 })
49
+
42
50
context .clear ()
43
51
self .assertEqual (context .sourceDatumTransforms (), {})
44
52
@@ -58,6 +66,14 @@ def testDestDatumTransforms(self):
58
66
self .assertFalse (context .addDestinationDatumTransform (QgsCoordinateReferenceSystem (), 4 ))
59
67
self .assertEqual (context .destinationDatumTransforms (), {'EPSG:3111' : 1 , 'EPSG:28356' : 3 })
60
68
69
+ # removing non-existing
70
+ self .assertTrue (context .addDestinationDatumTransform (QgsCoordinateReferenceSystem (28357 ), - 1 ))
71
+ self .assertEqual (context .destinationDatumTransforms (), {'EPSG:3111' : 1 , 'EPSG:28356' : 3 })
72
+
73
+ # remove existing
74
+ self .assertTrue (context .addDestinationDatumTransform (QgsCoordinateReferenceSystem (28356 ), - 1 ))
75
+ self .assertEqual (context .destinationDatumTransforms (), {'EPSG:3111' : 1 })
76
+
61
77
context .clear ()
62
78
self .assertEqual (context .destinationDatumTransforms (), {})
63
79
@@ -94,6 +110,27 @@ def testSourceDestinationDatumTransforms(self):
94
110
('EPSG:28356' , 'EPSG:4283' ): (3 , 4 ),
95
111
('EPSG:28356' , 'EPSG:28357' ): (9 , 11 )})
96
112
113
+ # removing non-existing
114
+ self .assertTrue (context .addSourceDestinationDatumTransform (QgsCoordinateReferenceSystem (28357 ),
115
+ QgsCoordinateReferenceSystem (28356 ), - 1 , - 1 ))
116
+ self .assertEqual (context .sourceDestinationDatumTransforms (), {('EPSG:3111' , 'EPSG:4283' ): (1 , 2 ),
117
+ ('EPSG:28356' , 'EPSG:4283' ): (3 , 4 ),
118
+ ('EPSG:28356' , 'EPSG:28357' ): (9 , 11 )})
119
+ self .assertTrue (context .addSourceDestinationDatumTransform (QgsCoordinateReferenceSystem (3111 ),
120
+ QgsCoordinateReferenceSystem (28356 ), - 1 , - 1 ))
121
+ self .assertEqual (context .sourceDestinationDatumTransforms (), {('EPSG:3111' , 'EPSG:4283' ): (1 , 2 ),
122
+ ('EPSG:28356' , 'EPSG:4283' ): (3 , 4 ),
123
+ ('EPSG:28356' , 'EPSG:28357' ): (9 , 11 )})
124
+
125
+ # remove existing
126
+ self .assertTrue (context .addSourceDestinationDatumTransform (QgsCoordinateReferenceSystem (3111 ),
127
+ QgsCoordinateReferenceSystem (4283 ), - 1 , 3 ))
128
+ self .assertEqual (context .sourceDestinationDatumTransforms (), {('EPSG:28356' , 'EPSG:4283' ): (3 , 4 ),
129
+ ('EPSG:28356' , 'EPSG:28357' ): (9 , 11 )})
130
+ self .assertTrue (context .addSourceDestinationDatumTransform (QgsCoordinateReferenceSystem (28356 ),
131
+ QgsCoordinateReferenceSystem (28357 ), 1 , - 1 ))
132
+ self .assertEqual (context .sourceDestinationDatumTransforms (), {('EPSG:28356' , 'EPSG:4283' ): (3 , 4 )})
133
+
97
134
context .clear ()
98
135
self .assertEqual (context .sourceDestinationDatumTransforms (), {})
99
136
0 commit comments