Using Postgis 2.1 on PostgreSQL 9.3.4, I'm getting an error when I try to intersect two valid geometries:

TopologyException: found non-noded intersection...

These geometries are created on the fly and are just 2 of a much larger table so while the usual tricks (a tiny buffer around either geoms) fixes it in this case, they are not practical in production with large geometry sets.

How can I avoid this in a consistent, performant manner?

See here for code snippet with geometries.

  • Works on postgis 2.2 with postgres 9.4.5. You can try ST_SnapToGrid, that might help. – Michal Zimmermann Nov 3 '15 at 7:31
  • Did you try it without the ST_Buffer() calls? I accidentally left those in the snippet (but just removed them) – Dylan Hettinger Nov 3 '15 at 16:24
  • You're right, not working without them. I tried with sfcgal backend as well, the error returned looks as follows: psql:test.sql:3: NOTICE: During intersection(A,B) : psql:test.sql:3: NOTICE: with A: ... psql:test.sql:3: NOTICE: and B: ... psql:test.sql:3: ERROR: Intersection does not support polygon with connected rings Could you try snapping to grid as I supposed earlier? – Michal Zimmermann Nov 3 '15 at 16:46
  • ST_SnapToGrid on the sample geoms changed it to a self-intersection error. I'll try reducing the precision on the original input geometries and re-run the full suite of queries; perhaps that will prevent it from happening in the first place. – Dylan Hettinger Nov 3 '15 at 19:55

Your Answer

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

Browse other questions tagged or ask your own question.