1

In running a spatial query in postgres, I got the following error:

psycopg2.errors.InternalError_: lwgeom_intersection: GEOS Error: TopologyException: Input geom 1 is invalid: Self-intersection at or near point 676597.26377722982 3673373.5709498846 at 676597.26377722982 3673373.5709498846

I do not know what projection is returned. The input is all (as well as I understand it) ESPG 4326, but these are obviously not points that work in that projection. How do I decipher what to convert from so I can locate the error?

CNIDog
  • 374
  • 3
  • 18

1 Answers1

0

The error was misreported by psycopg2 as a geometry error when it was actually a SQL error. The SQL had been changed to use a simplified polygon returned as simple_envelope (previously envelope), but the query was looking for envelope in some branches of a CASE statement. The actual error was a missing column, but psycopg2 returned the bad geometry error with cryptic coordinates.

CNIDog
  • 374
  • 3
  • 18