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:
parent
6349985e70
commit
40a7292a8d
@ -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."
|
||||
try:
|
||||
ptr = get_layer_srs(self._ptr)
|
||||
if ptr:
|
||||
return SpatialReference(clone_srs(ptr))
|
||||
else:
|
||||
except SRSException:
|
||||
return None
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user