I have a simple query filtering by st_intersects
function finding all lines intersecting with a polygon.
select *, st_intersect(graph_line, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,261 156))')
from graph_schema.graph_line
where graph_id=<ID> and st_intersect(graph_line, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,261 156))')
The problem is that for some data where a line is just a point the st_intersects
returns false even though it intersects. Furthermore even when the result is false it is returned in the result.
Examples:
select st_intersects(st_geomfromtext('LINESTRING(480 270,480 270)')::geometry, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,261 156))')::geometry);
returns false, but where condition does not filter it when the first parameter is taken from the table - and even when the object should spatialy intersect.
Is this because of the LINESTRING being just a point? Or what can be the problem?