I have a PostGIS query that counts the length of individual lines in each buffer:
SELECT buffered.name, ST_LENGTH(ST_Intersection(buffered.buffer, lines.wkb_geometry)) AS total_length FROM buffered, lines WHERE ST_Intersects(buffered.buffer, lines.wkb_geometry) GROUP BY buffered.name, buffered.buffer, lines.wkb_geometry
On one table of lines, the query runs successfully, but with a different one, psql throws the following error:
ERROR: Error performing intersection: InterruptedException: Interrupted!
I have tried everything, I validated geometries on both tables with
ST_MakeValid() and dropped lines from the table that have 0 length.
If both geometries are valid, how is it possible to get an error performing an intersection and what could be going wrong? Is there a way to skip the errors? Note:
buffered.buffer is of type geometry
Other important info: the query seems to run endlessly in psql: after about an hour, I cancelled the query and this is the message that was returned:
Cancel request sent ERROR: Error performing intersection: InterruptedException: Interrupted!
If I cancel the request after 5 or 10 minutes, no such error occurs and the log only shows
Cancel request sent ERROR: canceling statement due to user request