mirror of
https://github.com/django/django.git
synced 2025-11-23 12:26:57 +00:00
Fixed #25585 -- Allowed setting OGRGeometry srid/srs attributes to None.
This commit is contained in:
parent
80855a4b37
commit
0dbe897ab5
2 changed files with 8 additions and 1 deletions
|
|
@ -270,6 +270,8 @@ class OGRGeometry(GDALBase):
|
|||
elif isinstance(srs, six.integer_types + six.string_types):
|
||||
sr = SpatialReference(srs)
|
||||
srs_ptr = sr.ptr
|
||||
elif srs is None:
|
||||
srs_ptr = None
|
||||
else:
|
||||
raise TypeError('Cannot assign spatial reference with object of type: %s' % type(srs))
|
||||
capi.assign_srs(self.ptr, srs_ptr)
|
||||
|
|
@ -284,7 +286,7 @@ class OGRGeometry(GDALBase):
|
|||
return None
|
||||
|
||||
def _set_srid(self, srid):
|
||||
if isinstance(srid, six.integer_types):
|
||||
if isinstance(srid, six.integer_types) or srid is None:
|
||||
self.srs = srid
|
||||
else:
|
||||
raise TypeError('SRID must be set with an integer.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue