Changeset 7463
- Timestamp:
- 04/25/08 18:52:41 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/tests/test_geos.py
r7404 r7463 9 9 10 10 class GEOSTest(unittest.TestCase): 11 12 @property 13 def null_srid(self): 14 """ 15 Returns the proper null SRID depending on the GEOS version. 16 See the comments in `test15_srid` for more details. 17 """ 18 info = geos_version_info() 19 if info['version'] == '3.0.0' and info['release_candidate']: 20 return -1 21 else: 22 return None 11 23 12 24 def test01a_wkt(self): … … 499 511 self.assertEqual(4326, p1.srid) 500 512 501 # However, when HEX is exported, the SRID information is lost 502 # and set to -1. Essentially, the 'E' of the EWKB is not 503 # encoded in HEX by the GEOS C library unless the GEOSWKBWriter 504 # method is used. GEOS 3.0.0 will not encode -1 in the HEX 505 # as is done in the release candidates. 506 info = geos_version_info() 507 if info['version'] == '3.0.0' and info['release_candidate']: 508 exp_srid = -1 509 else: 510 exp_srid = None 513 # In GEOS 3.0.0rc1-4 when the EWKB and/or HEXEWKB is exported, 514 # the SRID information is lost and set to -1 -- this is not a 515 # problem on the 3.0.0 version (another reason to upgrade). 516 exp_srid = self.null_srid 511 517 512 518 p2 = fromstr(p1.hex) … … 745 751 tgeoms.extend(get_geoms(polygons, 3084)) 746 752 tgeoms.extend(get_geoms(multipolygons, 900913)) 747 753 754 # The SRID won't be exported in GEOS 3.0 release candidates. 755 no_srid = self.null_srid == -1 748 756 for geom in tgeoms: 749 757 s1, s2 = cPickle.dumps(geom), pickle.dumps(geom) … … 751 759 for tmpg in (g1, g2): 752 760 self.assertEqual(geom, tmpg) 753 self.assertEqual(geom.srid, tmpg.srid)761 if not no_srid: self.assertEqual(geom.srid, tmpg.srid) 754 762 755 763 def suite():
