1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

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

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2007-12-13 03:08:06 +00:00
parent 6349985e70
commit 40a7292a8d

View File

@ -3,7 +3,7 @@ from ctypes import byref
# Other GDAL imports.
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.feature import Feature
from django.contrib.gis.gdal.geometries import OGRGeomType
from django.contrib.gis.gdal.srs import SpatialReference
@ -99,10 +99,10 @@ class Layer(object):
@property
def srs(self):
"Returns the Spatial Reference used in this Layer."
ptr = get_layer_srs(self._ptr)
if ptr:
try:
ptr = get_layer_srs(self._ptr)
return SpatialReference(clone_srs(ptr))
else:
except SRSException:
return None
@property