Skip to content
Permalink
Browse files

Update test to reflect changes in proj library

(cherry picked from commit 67f25fe)
  • Loading branch information
nyalldawson committed Dec 17, 2019
1 parent b2a8bcd commit 273bd5576b9978776edd7150951c6dcbe5465705
Showing with 12 additions and 8 deletions.
  1. +12 −8 tests/src/python/test_qgsdatumtransforms.py
@@ -82,8 +82,8 @@ def testOperations(self):
self.assertEqual(len(ops[op2_index].grids), 1)
self.assertEqual(ops[op2_index].grids[0].shortName, 'GDA94_GDA2020_conformal_and_distortion.gsb')
self.assertEqual(ops[op2_index].grids[0].fullName, '')
self.assertEqual(ops[op2_index].grids[0].packageName, 'proj-datumgrid-oceania')
self.assertEqual(ops[op2_index].grids[0].url, 'https://download.osgeo.org/proj/proj-datumgrid-oceania-latest.zip')
self.assertTrue(ops[op2_index].grids[0].packageName)
self.assertIn('http', ops[op2_index].grids[0].url)
self.assertTrue(ops[op2_index].grids[0].directDownload)
self.assertTrue(ops[op2_index].grids[0].openLicense)

@@ -94,8 +94,8 @@ def testOperations(self):
self.assertEqual(len(ops[op3_index].grids), 1)
self.assertEqual(ops[op3_index].grids[0].shortName, 'GDA94_GDA2020_conformal.gsb')
self.assertEqual(ops[op3_index].grids[0].fullName, '')
self.assertEqual(ops[op3_index].grids[0].packageName, 'proj-datumgrid-oceania')
self.assertEqual(ops[op3_index].grids[0].url, 'https://download.osgeo.org/proj/proj-datumgrid-oceania-latest.zip')
self.assertTrue(ops[op3_index].grids[0].packageName)
self.assertIn('http', ops[op3_index].grids[0].url)
self.assertTrue(ops[op3_index].grids[0].directDownload)
self.assertTrue(ops[op3_index].grids[0].openLicense)

@@ -106,6 +106,8 @@ def testOperations(self):
self.assertEqual(len(ops[op4_index].grids), 1)
self.assertEqual(ops[op4_index].grids[0].shortName, 'GDA94_GDA2020_conformal_cocos_island.gsb')
self.assertEqual(ops[op4_index].grids[0].fullName, '')
self.assertTrue(ops[op4_index].grids[0].packageName)
self.assertIn('http', ops[op4_index].grids[0].url)

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]
self.assertTrue(ops[op5_index].name)
@@ -114,6 +116,8 @@ def testOperations(self):
self.assertEqual(len(ops[op5_index].grids), 1)
self.assertEqual(ops[op5_index].grids[0].shortName, 'GDA94_GDA2020_conformal_christmas_island.gsb')
self.assertEqual(ops[op5_index].grids[0].fullName, '')
self.assertTrue(ops[op5_index].grids[0].packageName)
self.assertIn('http', ops[op5_index].grids[0].url)

# uses a pivot datum (technically a proj test, but this will help me sleep at night ;)
ops = QgsDatumTransform.operations(QgsCoordinateReferenceSystem('EPSG:3111'),
@@ -135,8 +139,8 @@ def testOperations(self):
self.assertEqual(len(ops[op2_index].grids), 1)
self.assertEqual(ops[op2_index].grids[0].shortName, 'GDA94_GDA2020_conformal_and_distortion.gsb')
self.assertEqual(ops[op2_index].grids[0].fullName, '')
self.assertEqual(ops[op2_index].grids[0].packageName, 'proj-datumgrid-oceania')
self.assertEqual(ops[op2_index].grids[0].url, 'https://download.osgeo.org/proj/proj-datumgrid-oceania-latest.zip')
self.assertTrue(ops[op2_index].grids[0].packageName)
self.assertIn('http', ops[op2_index].grids[0].url)
self.assertTrue(ops[op2_index].grids[0].directDownload)
self.assertTrue(ops[op2_index].grids[0].openLicense)

@@ -147,8 +151,8 @@ def testOperations(self):
self.assertEqual(len(ops[op3_index].grids), 1)
self.assertEqual(ops[op3_index].grids[0].shortName, 'GDA94_GDA2020_conformal.gsb')
self.assertEqual(ops[op3_index].grids[0].fullName, '')
self.assertEqual(ops[op3_index].grids[0].packageName, 'proj-datumgrid-oceania')
self.assertEqual(ops[op3_index].grids[0].url, 'https://download.osgeo.org/proj/proj-datumgrid-oceania-latest.zip')
self.assertTrue(ops[op3_index].grids[0].packageName)
self.assertIn('http', ops[op3_index].grids[0].url)
self.assertTrue(ops[op3_index].grids[0].directDownload)
self.assertTrue(ops[op3_index].grids[0].openLicense)

0 comments on commit 273bd55

Please sign in to comment.
You can’t perform that action at this time.