diff options
| author | Justin Bronn <jbronn@gmail.com> | 2007-12-13 03:08:06 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2007-12-13 03:08:06 +0000 |
| commit | 40a7292a8dbd94db481e3aed9177dfe8bad788a4 (patch) | |
| tree | 5a6676a280449ad16944a7ea41635332914fc8de | |
| parent | 6349985e70411445589bb420dba54e0853f8ff75 (diff) | |
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
| -rw-r--r-- | django/contrib/gis/gdal/layer.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/contrib/gis/gdal/layer.py b/django/contrib/gis/gdal/layer.py index a3ef97e85e..d4d8e1b7c6 100644 --- a/django/contrib/gis/gdal/layer.py +++ b/django/contrib/gis/gdal/layer.py @@ -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 |
