  def add_postgis_srs(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None):
      """
      This function takes a GDAL SpatialReference system and adds its
      information to the PostGIS `spatial_ref_sys` table -- enabling
      spatial transformations with PostGIS.  This is handy for adding
      spatial reference systems not included by default with PostGIS.
 
</s> remove     This function takes a GDAL SpatialReference system and adds its
    information to the PostGIS `spatial_ref_sys` table -- enabling
    spatial transformations with PostGIS.  This is handy for adding
    spatial reference systems not included by default with PostGIS.
    For example, the following adds the so-called "Google Maps Mercator
    Projection" (available in GDAL 1.5):
 </s> add     This function takes a GDAL SpatialReference system and adds its information
    to the `spatial_ref_sys` table of the spatial backend.  Doing this enables
    database-level spatial transformations for the backend.  Thus, this utility
    is useful for adding spatial reference systems not included by default with
    the backend -- for example, the so-called "Google Maps Mercator Projection"
    is excluded in PostGIS 1.3 and below, and the following adds it to the
    `spatial_ref_sys` table: </s> remove     >>> add_postgis_srs(SpatialReference(900913))
 </s> add     >>> from django.contrib.gis.utils import add_srs_entry
    >>> add_srs_entry(900913) </s> remove         raise Exception('Spatial reference requires an SRID to be compatible with PostGIS.')
 </s> add         raise Exception('Spatial reference requires an SRID to be '
                        'compatible with the spatial backend.') </s> remove     # Initializing the keyword arguments dictionary for both PostGIS and SpatiaLite.
 </s> add     # Initializing the keyword arguments dictionary for both PostGIS
    # and SpatiaLite.
from django.contrib.gis.gdal import SpatialReference
from django.db import connections, DEFAULT_DB_ALIAS

def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
                  database=DEFAULT_DB_ALIAS):
from django.contrib.gis.gdal import SpatialReference
from django.db import connections, DEFAULT_DB_ALIAS

def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
                  database=DEFAULT_DB_ALIAS):
      """
      This function takes a GDAL SpatialReference system and adds its
      information to the PostGIS `spatial_ref_sys` table -- enabling
      spatial transformations with PostGIS.  This is handy for adding
      spatial reference systems not included by default with PostGIS.
replace keep keep keep keep keep
 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. 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12228 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/contrib/gis/utils/srs.py