Django

Code

Changeset 6979

Show
Ignore:
Timestamp:
12/27/07 15:44:33 (6 months ago)
Author:
jbronn
Message:

gis: lowered test transformation precision due to variations in updated PROJ and GDAL versions (i.e., tests run for GDAL 1.5 and PROJ 4.6.0).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/tests/geoapp/tests.py

    r6886 r6979  
    156156        htown = fromstr('POINT(1947516.83115183 6322297.06040572)', srid=3084) 
    157157        ptown = fromstr('POINT(992363.390841912 481455.395105533)', srid=2774) 
     158        prec = 3 # Precision is low due to version variations in PROJ and GDAL. 
    158159 
    159160        # Asserting the result of the transform operation with the values in 
     
    162163            h = City.objects.transform('point', srid=htown.srid).get(name='Houston') 
    163164            self.assertEqual(3084, h.point.srid) 
    164             self.assertAlmostEqual(htown.x, h.point.x, 8
    165             self.assertAlmostEqual(htown.y, h.point.y, 8
     165            self.assertAlmostEqual(htown.x, h.point.x, prec
     166            self.assertAlmostEqual(htown.y, h.point.y, prec
    166167 
    167168        p1 = City.objects.transform('point', srid=ptown.srid).get(name='Pueblo') 
     
    169170        for p in [p1, p2]: 
    170171            self.assertEqual(2774, p.point.srid) 
    171             self.assertAlmostEqual(ptown.x, p.point.x, 7
    172             self.assertAlmostEqual(ptown.y, p.point.y, 7
     172            self.assertAlmostEqual(ptown.x, p.point.x, prec
     173            self.assertAlmostEqual(ptown.y, p.point.y, prec
    173174 
    174175    def test09_disjoint(self): 
  • django/branches/gis/django/contrib/gis/tests/test_gdal_geom.py

    r6862 r6979  
    255255    def test09b_srs_transform(self): 
    256256        "Testing transform()." 
    257         orig = OGRGeometry('POINT (-104.609252 38.255001)', 4326) 
    258         trans = OGRGeometry('POINT(992363.390841912 481455.395105533)', 2774) 
     257        orig = OGRGeometry('POINT (-104.609 38.255)', 4326) 
     258        trans = OGRGeometry('POINT (992385.4472045 481455.4944650)', 2774) 
    259259 
    260260        # Using an srid, a SpatialReference object, and a CoordTransform object 
     
    267267 
    268268        for p in (t1, t2, t3): 
    269             self.assertAlmostEqual(trans.x, p.x, 7) 
    270             self.assertAlmostEqual(trans.y, p.y, 7) 
     269            prec = 3 
     270            self.assertAlmostEqual(trans.x, p.x, prec) 
     271            self.assertAlmostEqual(trans.y, p.y, prec) 
    271272 
    272273    def test10_difference(self):