Kaydet (Commit) a272db70 authored tarafından Sergey Fedoseev's avatar Sergey Fedoseev Kaydeden (comit) Claude Paroz

Fixed #25580 -- Allowed `None` to be set as SRID value.

üst 48888a1a
......@@ -366,7 +366,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
def set_srid(self, srid):
"Sets the SRID for the geometry."
capi.geos_set_srid(self.ptr, srid)
capi.geos_set_srid(self.ptr, 0 if srid is None else srid)
srid = property(get_srid, set_srid)
# #### Output Routines ####
......
......@@ -650,6 +650,10 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
p3 = fromstr(p1.hex, srid=-1) # -1 is intended.
self.assertEqual(-1, p3.srid)
# Testing that geometry SRID could be set to its own value
pnt_wo_srid = Point(1, 1)
pnt_wo_srid.srid = pnt_wo_srid.srid
@skipUnless(HAS_GDAL, "GDAL is required.")
def test_custom_srid(self):
""" Test with a srid unknown from GDAL """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment