I'm getting a lot of errors like this:

GEOSUnaryUnion: TopologyException: found non-noded intersection between LINESTRING (147.254 -42.8705, 147.254 -42.8705) and LINESTRING (147.254 -42.8705, 147.254 -42.8705) at 147.25355728849621 -42.870521684000678

I am calling ST_MakeValid(ST_Union(ST_SnapToGrid(mpoly))) on an aggregate of all rows that match my filter.

  • 1
    You want to call ST_MakeValid before ST_Union. If union runs into an invalid geometry, it's more likely to throw a topo exception – LR1234567 Oct 6 '15 at 6:04
  • 1
    Turns out this isn't enough. – Danielle Madeley Oct 8 '15 at 0:01
  • yeah I ran MakeValid before Union and I still got this error – Theo F Feb 28 '19 at 16:43

There is a similar question at How best to fix a non-noded intersection problem in PostGIS?. Some have had success by performing ST_MakeValid, ST_Buffer or ST_SnapToGrid to the geometry before to performing the union. I see you tried SnapToGrid. Have you tried something like:



ST_Union(ST_Buffer(mpoly, 1e-5))

The presentation PostGIS: Tips for Power Users outlines some potential sources of trouble when unioning geometries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.