#13256: OGRGeometry equals throws exception when compared to None
------------------------+---------------------------------------------------
Reporter: ninowalker | Owner: nobody
Status: new | Milestone:
Component: GIS | Version: 1.1
Keywords: GDAL | Stage: Unreviewed
Has_patch: 0 |
------------------------+---------------------------------------------------
The following generates an exception:
{{{
>>> from django.contrib.gis.gdal import OGRGeometry
>>> geom = OGRGeometry("POINT(0 0)")
>>> if geom == None:
... print 1
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/site-
packages/Django-1.1.1-py2.6.egg/django/contrib/gis/gdal/geometries.py",
line 166, in __eq__
return self.equals(other)
File "/usr/local/lib/python2.6/site-
packages/Django-1.1.1-py2.6.egg/django/contrib/gis/gdal/geometries.py",
line 397, in equals
return self._topology(capi.ogr_equals, other)
File "/usr/local/lib/python2.6/site-
packages/Django-1.1.1-py2.6.egg/django/contrib/gis/gdal/geometries.py",
line 385, in _topology
raise TypeError('Must use another OGRGeometry object for topology
operations!')
TypeError: Must use another OGRGeometry object for topology operations!
}}}
Equals (and other predicate methods), should probably test for None before
dispatching to the C bindings. No?
--
Ticket URL: <http://code.djangoproject.com/ticket/13256>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.