Opened 7 years ago

Closed 6 years ago

#4085 closed defect (wontfix)

ERROR: GEOSIntersects: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

Reported by: Gluchich Owned by: pramsey
Priority: medium Milestone: PostGIS 2.4.5
Component: postgis Version: 2.4.x
Keywords: non-finite numbers Cc:

Description

ST_Intersects fails with error: ERROR: GEOSIntersects: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

When one of the geometry like: POLYGON((-8482230.61661271 10018609.1889568,-8482230.61661272 10018609.1889568,-8482230.61661275 10018609.1889568,inf inf,inf inf,inf inf,inf inf ...

Example in attached file.

Is it possible to RETURN NULL, for example, and continue to run query?

Attachments (1)

st_intersects.sql (7.6 KB ) - added by Gluchich 7 years ago.

Download all attachments as: .zip

Change History (3)

by Gluchich, 7 years ago

Attachment: st_intersects.sql added

comment:1 by dbaston, 7 years ago

You can write your own wrapper function to catch the exception and return NULL:

CREATE OR REPLACE FUNCTION ST_Intersection_NullOnError(geometry, geometry)
RETURNS geometry AS
$$
BEGIN
RETURN ST_Intersection($1, $2);
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END
$$ LANGUAGE plpgsql;

comment:2 by pramsey, 6 years ago

Resolution: wontfix
Status: newclosed

Returning NULL on an exception is out of scope. As noted, you can check invalidity yourself and strip those inputs from the query, or make an exception catching wrapper.

Note: See TracTickets for help on using tickets.