Opened 6 years ago

Closed 6 years ago

#12591 closed (fixed)

django.contrib.gis.utils.srs is out of date

Reported by: yourcelf Owned by: nobody
Component: GIS Version: master
Severity: Keywords: srs add_postgis_srs
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

django.contrib.gis.utils.srs.add_postgis_srs fails with the following error:

ImportError                               Traceback (most recent call last)
/usr/local/lib/python2.6/dist-packages/django/contrib/gis/utils/srs.pyc in add_postgis_srs(srs, auth_name, auth_srid, ref_sys_name)
     22                    determined by GDAL.
     23     """
---> 24     from django.contrib.gis.db.backend import SpatialBackend
     25     from django.contrib.gis.models import SpatialRefSys
     26     from django.contrib.gis.gdal import SpatialReference

ImportError: No module named backend

This is because the django.contrib.gis.db.backend module no longer exists (it has been renamed "backends"), and the SpatialBackend class is no longer defined.

Thus the following instructions in geodjango documentation fail:
http://geodjango.org/docs/install.html#add-google-projection-to-spatial-ref-sys-table

Change History (1)

comment:1 Changed 6 years ago by jbronn

  • Resolution set to fixed
  • Status changed from new to closed

(In [12228]) Fixed #12591 -- Renamed add_postgis_srs to add_srs_entry (keeping backwards-compatible alias), added database keyword for multi-db, removed deprecated SpatialBackend references; no longer use get_or_create and look for existing entry based on SRID value.

Note: See TracTickets for help on using tickets.
Back to Top