Django

Code

Changeset 6916

Show
Ignore:
Timestamp:
12/12/07 21:08:06 (8 months ago)
Author:
jbronn
Message:

gis: gdal: Fixed bug in the property so that no exception is raised when the spatial reference is undefined (Thanks Joe).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/gdal/layer.py

    r6686 r6916  
    44# Other GDAL imports. 
    55from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope 
    6 from django.contrib.gis.gdal.error import OGRException, OGRIndexError 
     6from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException 
    77from django.contrib.gis.gdal.feature import Feature 
    88from django.contrib.gis.gdal.geometries import OGRGeomType 
     
    100100    def srs(self): 
    101101        "Returns the Spatial Reference used in this Layer." 
    102         ptr = get_layer_srs(self._ptr) 
    103         if ptr: 
     102        try: 
     103            ptr = get_layer_srs(self._ptr) 
    104104            return SpatialReference(clone_srs(ptr)) 
    105         else
     105        except SRSException
    106106            return None 
    107107