#25651: `GEOSException` during operations on some GeometryCollections
-------------------------------+--------------------
Reporter: sir-sigurd | Owner: nobody
Type: Uncategorized | Status: new
Component: GIS | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
{{{
In [16]: gc = GeometryCollection(GEOSGeometry('POLYGON((0 0, 0 4, 4 4, 4
0, 0 0))'), GEOSGeometry('POLYGON ((3 3, 3 4, 4 4, 4 3, 3 3))'))
In [17]: gc.union(gc)
GEOS_ERROR: TopologyException: side location conflict at 3 4
---------------------------------------------------------------------------
GEOSException Traceback (most recent call
last)
<ipython-input-17-9fc656c75d73> in <module>()
----> 1 gc.union(gc)
/home/sergey/dev/django/django/contrib/gis/geos/geometry.py in union(self,
other)
610 def union(self, other):
611 "Returns a Geometry representing all the points in this
Geometry and other."
--> 612 return self._topology(capi.geos_union(self.ptr,
other.ptr))
613
614 # #### Other Routines ####
/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 "GEOSUnion_r".
}}}
in psql
{{{
test_django=# SELECT ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION (POLYGON
((0 0, 0 4, 4 4, 4 0, 0 0)), POLYGON ((3 3, 3 4, 4 4, 4 3, 3 3)))'),
ST_GeomFromText('GEOMETRYCOLLECTION (POLYGON ((0 0, 0 4, 4 4, 4 0, 0 0)),
POLYGON ((3 3, 3 4, 4 4, 4 3, 3 3)))'));
ОШИБКА: GEOSUnion: TopologyException: side location conflict at 3 4
}}}
As it reproducible in Postges, it appears this is a bug in GEOS, so I
[https://trac.osgeo.org/geos/ticket/752 reported] it, but if decide to
wrap it up in Django, I have an idea for this.
--
Ticket URL: <https://code.djangoproject.com/ticket/25651>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.94709ac86dd3e6a2235007f47dce69ec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.