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.
* status: new => assigned
* owner: nobody => sir-sigurd
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25651#comment:1>
Comment (by claudep):
Let's see your idea before accepting the ticket. Normally I would close it
as not related to Django. But if there is a not-to-hairy workaround, why
not...
--
Ticket URL: <https://code.djangoproject.com/ticket/25651#comment:2>
Comment (by sir-sigurd):
The idea is to use `unary_union` implicitly for both geometries for such
methods as `equals`, `difference`, etc. I'm not sure this is a good idea
and think that this error is occurred really rarely in the wild.
--
Ticket URL: <https://code.djangoproject.com/ticket/25651#comment:3>
* status: assigned => closed
* resolution: => wontfix
Comment:
I'll close it for now, but if anyone comes with a working patch, we can
reconsider the decision.
--
Ticket URL: <https://code.djangoproject.com/ticket/25651#comment:4>