Unexpected TopologyException during ST_Union aggregate function with valid polygons
|Reported by:||blaggner||Owned by:||pramsey|
When aggregating geometries of a large table (53.5 Mio. polygons) with ST_Union grouped by an ID column (resulting rows at the end: 2958073), ST_Union threw an error: ERROR: GEOSUnaryUnion: TopologyException: found non-noded intersection between LINESTRING (3.3987e+06 5.33572e+06, 3.3987e+06 5.33572e+06) and LINESTRING (3.3987e+06 5.33572e+06, 3.3987e+06 5.33572e+06) at 3398704.354833886 5335719.4814453134 I tested the geometries of the table with ST_IsValid and there were no invalid geometries. With the help of a wrapper function, I was able to identify the rows that were causing the problem (see attached data). However, when trying to reproduce the error on the selected geometries, ST_Union was able to aggregate the geometries without a problem.