diff --git a/tests/gis_tests/gdal_tests/test_raster.py b/tests/gis_tests/gdal_tests/test_raster.py index eea92617c9..8aff5bcec4 100644 --- a/tests/gis_tests/gdal_tests/test_raster.py +++ b/tests/gis_tests/gdal_tests/test_raster.py @@ -360,8 +360,10 @@ class GDALRasterTests(unittest.TestCase): self.assertEqual(target.width, 7) self.assertEqual(target.height, 7) self.assertEqual(target.bands[0].datatype(), source.bands[0].datatype()) - self.assertEqual(target.origin, [9124842.791079799, 1589911.6476407414]) - self.assertEqual(target.scale, [223824.82664250192, -223824.82664250192]) + self.assertAlmostEqual(target.origin[0], 9124842.791079799) + self.assertAlmostEqual(target.origin[1], 1589911.6476407414) + self.assertAlmostEqual(target.scale[0], 223824.82664250192) + self.assertAlmostEqual(target.scale[1], -223824.82664250192) self.assertEqual(target.skew, [0, 0]) result = target.bands[0].data() diff --git a/tests/gis_tests/rasterapp/test_rasterfield.py b/tests/gis_tests/rasterapp/test_rasterfield.py index 5934fcc690..e0a7ff2a5a 100644 --- a/tests/gis_tests/rasterapp/test_rasterfield.py +++ b/tests/gis_tests/rasterapp/test_rasterfield.py @@ -99,11 +99,12 @@ class RasterFieldTest(TransactionTestCase): # Confirm raster has been transformed to the default srid self.assertEqual(r.rast.srs.srid, 4326) # Confirm geotransform is in lat/lon - self.assertEqual( - r.rast.geotransform, - [-87.9298551266551, 9.459646421449934e-06, 0.0, - 23.94249275457565, 0.0, -9.459646421449934e-06] - ) + expected = [ + -87.9298551266551, 9.459646421449934e-06, 0.0, 23.94249275457565, + 0.0, -9.459646421449934e-06, + ] + for val, exp in zip(r.rast.geotransform, expected): + self.assertAlmostEqual(exp, val) def test_verbose_name_arg(self): """