# [geos-devel] Topology Exception with nested collections

Obe, Regina robe.dnd at cityofboston.gov
Wed Jan 20 14:41:26 EST 2010

```I'm actually not sure if this is a bug or not, but I always thought in a perfect world that if I union two valid geometries, I should not get errors.  I get a bunch of these in my torture tests (both against 3.1.1 and 3.2.0 GEOS) and verified they  pass the ST_IsValid test.

One of these cases stripped down to its bear minimum - gives error :
NOTICE:  TopologyException: side location conflict -9 50 --.  Anyway thought I would mention it in case its not a trivial thing.  I doubt anyone has monsters like this anyway.

SELECT ST_Union(foo1.geom, foo2.geom)
FROM (SELECT ST_GeomFromEWKT('SRID=4326;GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(-10 50),POLYGON((-9 50,51 -11,-10 50,-9 50))),GEOMETRYCOLLECTION(POINT(-10 70),POLYGON((-9 70,71 -11,-10 70,-9 70))),GEOMETRYCOLLECTION(POINT(-10 50),POLYGON((-8 50,52 -12,-10 50,-8 50))),GEOMETRYCOLLECTION(POINT(-10 70),POLYGON((-8 70,72 -12,-10 70,-8 70))),GEOMETRYCOLLECTION(POINT(10 50),POLYGON((11 50,51 9,10 50,11 50))),GEOMETRYCOLLECTION(POINT(10 70),POLYGON((11 70,71 9,10 70,11 70))),GEOMETRYCOLLECTION(POINT(10 50),POLYGON((12 50,52 8,10 50,12 50))),GEOMETRYCOLLECTION(POINT(10 70),POLYGON((12 70,72 8,10 70,12 70))),GEOMETRYCOLLECTION(POINT(30 50),POLYGON((31 50,51 29,30 50,31 50))),GEOMETRYCOLLECTION(POINT(30 70),POLYGON((31 70,71 29,30 70,31 70))),GEOMETRYCOLLECTION(POINT(30 50),POLYGON((32 50,52 28,30 50,32 50))),GEOMETRYCOLLECTION(POINT(30 70),POLYGON((32 70,72 28,30 70,32 70))),GEOMETRYCOLLECTION(POINT(50 50),POLYGON((51 50,51 49,50 50,51 50))),GEOMETRYCOLLECTION(POINT(50 70),POLYGON((51 70,71 49,50 70,51 70))),GEOMETRYCOLLECTION(POINT(50 50),POLYGON((52 50,52 48,50 50,52 50))),GEOMETRYCOLLECTION(POINT(50 70),POLYGON((52 70,72 48,50 70,52 70))))') As geom) As foo1
CROSS JOIN
(SELECT ST_GeomFromEWKT('SRID=4326;GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(-10 50),POLYGON((-9 50,51 -11,-10 50,-9 50))),GEOMETRYCOLLECTION(POINT(-10 70),POLYGON((-9 70,71 -11,-10 70,-9 70))),GEOMETRYCOLLECTION(POINT(-10 50),POLYGON((-8 50,52 -12,-10 50,-8 50))),GEOMETRYCOLLECTION(POINT(-10 70),POLYGON((-8 70,72 -12,-10 70,-8 70))),GEOMETRYCOLLECTION(POINT(10 50),POLYGON((11 50,51 9,10 50,11 50))),GEOMETRYCOLLECTION(POINT(10 70),POLYGON((11 70,71 9,10 70,11 70))),GEOMETRYCOLLECTION(POINT(10 50),POLYGON((12 50,52 8,10 50,12 50))),GEOMETRYCOLLECTION(POINT(10 70),POLYGON((12 70,72 8,10 70,12 70))),GEOMETRYCOLLECTION(POINT(30 50),POLYGON((31 50,51 29,30 50,31 50))),GEOMETRYCOLLECTION(POINT(30 70),POLYGON((31 70,71 29,30 70,31 70))),GEOMETRYCOLLECTION(POINT(30 50),POLYGON((32 50,52 28,30 50,32 50))),GEOMETRYCOLLECTION(POINT(30 70),POLYGON((32 70,72 28,30 70,32 70))),GEOMETRYCOLLECTION(POINT(50 50),POLYGON((51 50,51 49,50 50,51 50))),GEOMETRYCOLLECTION(POINT(50 70),POLYGON((51 70,71 49,50 70,51 70))),GEOMETRYCOLLECTION(POINT(50 50),POLYGON((52 50,52 48,50 50,52 50))),GEOMETRYCOLLECTION(POINT(50 70),POLYGON((52 70,72 48,50 70,52 70))))') As geom) As foo2
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended