@@ -75,48 +75,100 @@ def testOperations(self):
75
75
self .assertEqual (ops [op1_index ].accuracy , 0.01 )
76
76
self .assertEqual (len (ops [op1_index ].grids ), 0 )
77
77
78
- op2_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
78
+ if QgsProjUtils .projVersionMajor () == 6 :
79
+ op2_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
80
+ else :
81
+ op2_index = [i for i in range (len (ops )) if ops [
82
+ i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_and_distortion.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][
83
+ 0 ]
79
84
self .assertTrue (ops [op2_index ].name )
80
- self .assertEqual (ops [op2_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
85
+ if QgsProjUtils .projVersionMajor () == 6 :
86
+ self .assertEqual (ops [op2_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
87
+ else :
88
+ self .assertEqual (ops [op2_index ].proj ,
89
+ '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_and_distortion.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
81
90
self .assertEqual (ops [op2_index ].accuracy , 0.05 )
82
91
self .assertEqual (len (ops [op2_index ].grids ), 1 )
83
- self .assertEqual (ops [op2_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_and_distortion.gsb' )
92
+ if QgsProjUtils .projVersionMajor () == 6 :
93
+ self .assertEqual (ops [op2_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_and_distortion.gsb' )
94
+ else :
95
+ self .assertEqual (ops [op2_index ].grids [0 ].shortName , 'au_icsm_GDA94_GDA2020_conformal_and_distortion.tif' )
84
96
self .assertEqual (ops [op2_index ].grids [0 ].fullName , '' )
85
- self .assertTrue (ops [op2_index ].grids [0 ].packageName )
97
+ if QgsProjUtils .projVersionMajor () == 6 :
98
+ self .assertTrue (ops [op2_index ].grids [0 ].packageName )
86
99
self .assertIn ('http' , ops [op2_index ].grids [0 ].url )
87
100
self .assertTrue (ops [op2_index ].grids [0 ].directDownload )
88
101
self .assertTrue (ops [op2_index ].grids [0 ].openLicense )
89
102
90
- op3_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
103
+ if QgsProjUtils .projVersionMajor () == 6 :
104
+ op3_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
105
+ else :
106
+ op3_index = [i for i in range (len (ops )) if ops [
107
+ i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][
108
+ 0 ]
91
109
self .assertTrue (ops [op3_index ].name )
92
- self .assertEqual (ops [op3_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
110
+ if QgsProjUtils .projVersionMajor () == 6 :
111
+ self .assertEqual (ops [op3_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
112
+ else :
113
+ self .assertEqual (ops [op3_index ].proj ,
114
+ '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
93
115
self .assertEqual (ops [op3_index ].accuracy , 0.05 )
94
116
self .assertEqual (len (ops [op3_index ].grids ), 1 )
95
- self .assertEqual (ops [op3_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal.gsb' )
117
+ if QgsProjUtils .projVersionMajor () == 6 :
118
+ self .assertEqual (ops [op3_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal.gsb' )
119
+ else :
120
+ self .assertEqual (ops [op3_index ].grids [0 ].shortName , 'au_icsm_GDA94_GDA2020_conformal.tif' )
96
121
self .assertEqual (ops [op3_index ].grids [0 ].fullName , '' )
97
- self .assertTrue (ops [op3_index ].grids [0 ].packageName )
122
+ if QgsProjUtils .projVersionMajor () == 6 :
123
+ self .assertTrue (ops [op3_index ].grids [0 ].packageName )
98
124
self .assertIn ('http' , ops [op3_index ].grids [0 ].url )
99
125
self .assertTrue (ops [op3_index ].grids [0 ].directDownload )
100
126
self .assertTrue (ops [op3_index ].grids [0 ].openLicense )
101
127
102
- op4_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_cocos_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
128
+ if QgsProjUtils .projVersionMajor () == 6 :
129
+ op4_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_cocos_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
130
+ else :
131
+ op4_index = [i for i in range (len (ops )) if ops [
132
+ i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_cocos_island.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][
133
+ 0 ]
103
134
self .assertTrue (ops [op4_index ].name )
104
- self .assertEqual (ops [op4_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_cocos_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
135
+ if QgsProjUtils .projVersionMajor () == 6 :
136
+ self .assertEqual (ops [op4_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_cocos_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
137
+ else :
138
+ self .assertEqual (ops [op4_index ].proj ,
139
+ '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_cocos_island.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
105
140
self .assertEqual (ops [op4_index ].accuracy , 0.05 )
106
141
self .assertEqual (len (ops [op4_index ].grids ), 1 )
107
- self .assertEqual (ops [op4_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_cocos_island.gsb' )
142
+ if QgsProjUtils .projVersionMajor () == 6 :
143
+ self .assertEqual (ops [op4_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_cocos_island.gsb' )
144
+ else :
145
+ self .assertEqual (ops [op4_index ].grids [0 ].shortName , 'au_icsm_GDA94_GDA2020_conformal_cocos_island.tif' )
108
146
self .assertEqual (ops [op4_index ].grids [0 ].fullName , '' )
109
- self .assertTrue (ops [op4_index ].grids [0 ].packageName )
147
+ if QgsProjUtils .projVersionMajor () == 6 :
148
+ self .assertTrue (ops [op4_index ].grids [0 ].packageName )
110
149
self .assertIn ('http' , ops [op4_index ].grids [0 ].url )
111
150
112
- op5_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_christmas_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
151
+ if QgsProjUtils .projVersionMajor () == 6 :
152
+ op5_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_christmas_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][0 ]
153
+ else :
154
+ op5_index = [i for i in range (len (ops )) if ops [
155
+ i ].proj == '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_christmas_island.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' ][
156
+ 0 ]
113
157
self .assertTrue (ops [op5_index ].name )
114
- self .assertEqual (ops [op5_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_christmas_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
158
+ if QgsProjUtils .projVersionMajor () == 6 :
159
+ self .assertEqual (ops [op5_index ].proj , '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_christmas_island.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
160
+ else :
161
+ self .assertEqual (ops [op5_index ].proj ,
162
+ '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_christmas_island.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg' )
115
163
self .assertEqual (ops [op5_index ].accuracy , 0.05 )
116
164
self .assertEqual (len (ops [op5_index ].grids ), 1 )
117
- self .assertEqual (ops [op5_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_christmas_island.gsb' )
165
+ if QgsProjUtils .projVersionMajor () == 6 :
166
+ self .assertEqual (ops [op5_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_christmas_island.gsb' )
167
+ else :
168
+ self .assertEqual (ops [op5_index ].grids [0 ].shortName , 'au_icsm_GDA94_GDA2020_conformal_christmas_island.tif' )
118
169
self .assertEqual (ops [op5_index ].grids [0 ].fullName , '' )
119
- self .assertTrue (ops [op5_index ].grids [0 ].packageName )
170
+ if QgsProjUtils .projVersionMajor () == 6 :
171
+ self .assertTrue (ops [op5_index ].grids [0 ].packageName )
120
172
self .assertIn ('http' , ops [op5_index ].grids [0 ].url )
121
173
122
174
# uses a pivot datum (technically a proj test, but this will help me sleep at night ;)
@@ -132,26 +184,52 @@ def testOperations(self):
132
184
self .assertEqual (ops [op1_index ].accuracy , 0.01 )
133
185
self .assertEqual (len (ops [op1_index ].grids ), 0 )
134
186
135
- op2_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' ][0 ]
187
+ if QgsProjUtils .projVersionMajor () == 6 :
188
+ op2_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' ][0 ]
189
+ else :
190
+ op2_index = [i for i in range (len (ops )) if ops [
191
+ i ].proj == '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_and_distortion.tif +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' ][
192
+ 0 ]
136
193
self .assertTrue (ops [op2_index ].name )
137
- self .assertEqual (ops [op2_index ].proj , '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' )
194
+ if QgsProjUtils .projVersionMajor () == 6 :
195
+ self .assertEqual (ops [op2_index ].proj , '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' )
196
+ else :
197
+ self .assertEqual (ops [op2_index ].proj ,
198
+ '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal_and_distortion.tif +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' )
138
199
self .assertEqual (ops [op2_index ].accuracy , 0.05 )
139
200
self .assertEqual (len (ops [op2_index ].grids ), 1 )
140
- self .assertEqual (ops [op2_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_and_distortion.gsb' )
201
+ if QgsProjUtils .projVersionMajor () == 6 :
202
+ self .assertEqual (ops [op2_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal_and_distortion.gsb' )
203
+ else :
204
+ self .assertEqual (ops [op2_index ].grids [0 ].shortName , 'au_icsm_GDA94_GDA2020_conformal_and_distortion.tif' )
141
205
self .assertEqual (ops [op2_index ].grids [0 ].fullName , '' )
142
- self .assertTrue (ops [op2_index ].grids [0 ].packageName )
206
+ if QgsProjUtils .projVersionMajor () == 6 :
207
+ self .assertTrue (ops [op2_index ].grids [0 ].packageName )
143
208
self .assertIn ('http' , ops [op2_index ].grids [0 ].url )
144
209
self .assertTrue (ops [op2_index ].grids [0 ].directDownload )
145
210
self .assertTrue (ops [op2_index ].grids [0 ].openLicense )
146
211
147
- op3_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' ][0 ]
212
+ if QgsProjUtils .projVersionMajor () == 6 :
213
+ op3_index = [i for i in range (len (ops )) if ops [i ].proj == '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' ][0 ]
214
+ else :
215
+ op3_index = [i for i in range (len (ops )) if ops [
216
+ i ].proj == '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal.tif +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' ][
217
+ 0 ]
148
218
self .assertTrue (ops [op3_index ].name )
149
- self .assertEqual (ops [op3_index ].proj , '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' )
219
+ if QgsProjUtils .projVersionMajor () == 6 :
220
+ self .assertEqual (ops [op3_index ].proj , '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=GDA94_GDA2020_conformal.gsb +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' )
221
+ else :
222
+ self .assertEqual (ops [op3_index ].proj ,
223
+ '+proj=pipeline +step +inv +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +step +proj=hgridshift +grids=au_icsm_GDA94_GDA2020_conformal.tif +step +proj=lcc +lat_0=-37 +lon_0=145 +lat_1=-36 +lat_2=-38 +x_0=2500000 +y_0=2500000 +ellps=GRS80' )
150
224
self .assertEqual (ops [op3_index ].accuracy , 0.05 )
151
225
self .assertEqual (len (ops [op3_index ].grids ), 1 )
152
- self .assertEqual (ops [op3_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal.gsb' )
226
+ if QgsProjUtils .projVersionMajor () == 6 :
227
+ self .assertEqual (ops [op3_index ].grids [0 ].shortName , 'GDA94_GDA2020_conformal.gsb' )
228
+ else :
229
+ self .assertEqual (ops [op3_index ].grids [0 ].shortName , 'au_icsm_GDA94_GDA2020_conformal.tif' )
153
230
self .assertEqual (ops [op3_index ].grids [0 ].fullName , '' )
154
- self .assertTrue (ops [op3_index ].grids [0 ].packageName )
231
+ if QgsProjUtils .projVersionMajor () == 6 :
232
+ self .assertTrue (ops [op3_index ].grids [0 ].packageName )
155
233
self .assertIn ('http' , ops [op3_index ].grids [0 ].url )
156
234
self .assertTrue (ops [op3_index ].grids [0 ].directDownload )
157
235
self .assertTrue (ops [op3_index ].grids [0 ].openLicense )
0 commit comments