In [3]: LinearRing([(0,0)])
GEOS_ERROR: IllegalArgumentException: point array must contain 0 or >1 elements
---------------------------------------------------------------------------
GEOSException Traceback (most recent call last)
<ipython-input-3-035f8526bfee> in <module>()
----> 1 LinearRing([(0,0)])
/home/sergey/dev/django/django/contrib/gis/geos/linestring.py in __init__(self, *args, **kwargs)
77 # Calling the base geometry initialization with the returned pointer
78 # from the function.
---> 79 super(LineString, self).__init__(self._init_func(cs.ptr), srid=srid)
80
81 def __iter__(self):
/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)
/home/sergey/dev/django/django/contrib/gis/geos/prototypes/errcheck.pyc in check_geom(result, func, cargs)
30 "Error checking on routines that return Geometries."
31 if not result:
---> 32 raise GEOSException('Error encountered checking Geometry returned from GEOS C function "%s".' % func.__name__)
33 return result
34
GEOSException: Error encountered checking Geometry returned from GEOS C function "GEOSGeom_createLinearRing_r".
In [4]: LineString([(0,0)])
GEOS_ERROR: IllegalArgumentException: point array must contain 0 or >1 elements
---------------------------------------------------------------------------
GEOSException Traceback (most recent call last)
<ipython-input-4-25f3ed7c8486> in <module>()
----> 1 LineString([(0,0)])
/home/sergey/dev/django/django/contrib/gis/geos/linestring.py in __init__(self, *args, **kwargs)
77 # Calling the base geometry initialization with the returned pointer
78 # from the function.
---> 79 super(LineString, self).__init__(self._init_func(cs.ptr), srid=srid)
80
81 def __iter__(self):
/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)
/home/sergey/dev/django/django/contrib/gis/geos/prototypes/errcheck.pyc in check_geom(result, func, cargs)
30 "Error checking on routines that return Geometries."
31 if not result:
---> 32 raise GEOSException('Error encountered checking Geometry returned from GEOS C function "%s".' % func.__name__)
33 return result
34
GEOSException: Error encountered checking Geometry returned from GEOS C function "GEOSGeom_createLineString_r".
Do you think it's better to get an exception from Django instead of GEOS? For what gain?