Fixed #22456 -- Replaced 900913 EPSG code by 3857 in some tests

3857 is now the official EPSG code for the Google spherical mercator
projection and some recent versions of GDAL do not recognize 900913
any longer.
Thanks Tim Graham for the report and initial patch.
This commit is contained in:
Claude Paroz 2014-04-17 21:10:41 +02:00
parent 00e3b9a2a9
commit c082f3c74c
3 changed files with 6 additions and 8 deletions

View File

@ -987,7 +987,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
tgeoms = get_geoms(self.geometries.points) tgeoms = get_geoms(self.geometries.points)
tgeoms.extend(get_geoms(self.geometries.multilinestrings, 4326)) tgeoms.extend(get_geoms(self.geometries.multilinestrings, 4326))
tgeoms.extend(get_geoms(self.geometries.polygons, 3084)) tgeoms.extend(get_geoms(self.geometries.polygons, 3084))
tgeoms.extend(get_geoms(self.geometries.multipolygons, 900913)) tgeoms.extend(get_geoms(self.geometries.multipolygons, 3857))
for geom in tgeoms: for geom in tgeoms:
s1, s2 = cPickle.dumps(geom), pickle.dumps(geom) s1, s2 = cPickle.dumps(geom), pickle.dumps(geom)

View File

@ -110,11 +110,11 @@ class SpatialRefSysTest(unittest.TestCase):
""" """
from django.contrib.gis.utils import add_srs_entry from django.contrib.gis.utils import add_srs_entry
add_srs_entry(900913) add_srs_entry(3857)
self.assertTrue( self.assertTrue(
SpatialRefSys.objects.filter(srid=900913).exists() SpatialRefSys.objects.filter(srid=3857).exists()
) )
srs = SpatialRefSys.objects.get(srid=900913) srs = SpatialRefSys.objects.get(srid=3857)
self.assertTrue( self.assertTrue(
SpatialRefSys.get_spheroid(srs.wkt).startswith('SPHEROID[') SpatialRefSys.get_spheroid(srs.wkt).startswith('SPHEROID[')
) )

View File

@ -9,12 +9,10 @@ def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
to the `spatial_ref_sys` table of the spatial backend. Doing this enables to the `spatial_ref_sys` table of the spatial backend. Doing this enables
database-level spatial transformations for the backend. Thus, this utility database-level spatial transformations for the backend. Thus, this utility
is useful for adding spatial reference systems not included by default with is useful for adding spatial reference systems not included by default with
the backend -- for example, the so-called "Google Maps Mercator Projection" the backend:
is excluded in PostGIS 1.3 and below, and the following adds it to the
`spatial_ref_sys` table:
>>> from django.contrib.gis.utils import add_srs_entry >>> from django.contrib.gis.utils import add_srs_entry
>>> add_srs_entry(900913) >>> add_srs_entry(3857)
Keyword Arguments: Keyword Arguments:
auth_name: auth_name: