Opened 9 years ago

Closed 9 years ago

#25580 closed Bug (fixed)

GEOSGeometry.srid cannot be set to None

Reported by: Sergey Fedoseev Owned by: nobody
Component: GIS Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In [1]: from django.contrib.gis.geos import Point

In [2]: p = Point(1, 1)

In [3]: p.srid is None
Out[3]: True

In [4]: p.srid = p.srid
---------------------------------------------------------------------------
ArgumentError                             Traceback (most recent call last)
<ipython-input-4-3612b78cc827> in <module>()
----> 1 p.srid = p.srid

/home/sergey/dev/django/django/contrib/gis/geos/geometry.py in set_srid(self, srid)
    367     def set_srid(self, srid):
    368         "Sets the SRID for the geometry."
--> 369         capi.geos_set_srid(self.ptr, srid)
    370     srid = property(get_srid, set_srid)
    371 

/home/sergey/dev/django/django/contrib/gis/geos/libgeos.pyc in __call__(self, *args, **kwargs)
    155         if self.func is None:
    156             self.func = self.get_func(*self.args, **self.kwargs)
--> 157         return self.func(*args, **kwargs)
    158 
    159     def get_func(self, *args, **kwargs):

/home/sergey/dev/django/django/contrib/gis/geos/prototypes/threadsafe.pyc in __call__(self, *args)
     54             # Call the threaded GEOS routine with pointer of the context handle
     55             # as the first argument.
---> 56             return self.cfunc(self.thread_context.handle.ptr, *args)
     57         else:
     58             return self.cfunc(*args)

ArgumentError: argument 3: <type 'exceptions.TypeError'>: wrong type

Change History (2)

comment:2 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: newclosed

In a272db7:

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

Note: See TracTickets for help on using tickets.
Back to Top