Ticket #15533: osmgeoadminfix.diff

File osmgeoadminfix.diff, 1.1 KB (added by cnorthwood, 13 years ago)
  • django/contrib/gis/admin/widgets.py

     
    11from django.conf import settings
    2 from django.contrib.gis.gdal import OGRException
     2from django.contrib.gis.gdal import OGRException, SRSException
    33from django.contrib.gis.geos import GEOSGeometry, GEOSException
    44from django.forms.widgets import Textarea
    55from django.template import loader, Context
     
    5454            if value.srid != srid:
    5555                try:
    5656                    ogr = value.ogr
    57                     ogr.transform(srid)
     57                    try:
     58                        ogr.transform(srid)
     59                    except SRSException:
     60                        # 900913 is deprecated, 3857 is the official projection
     61                        if srid == 900913:
     62                            ogr.transform(3857)
     63                        else:
     64                            raise
    5865                    wkt = ogr.wkt
    5966                except OGRException:
    6067                    wkt = ''
Back to Top