Opened 3 years ago

Last modified 2 years ago

#4932 closed defect

Possible Bug with geography ST_Intersects / ST_Distance — at Initial Version

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 3.3.0
Component: postgis Version: master
Keywords: Cc:

Description

Nek on PostGIS noted the documentation for geography ST_Intersects is wrong.

https://postgis.net/docs/ST_Intersects.html

In the docs it says this should return true

SELECT ST_Intersects(
		'SRID=4326;LINESTRING(-43.23456 72.4567,-43.23456 72.4568)'::geography,
		'SRID=4326;POINT(-43.23456 72.4567772)'::geography
		);

But it returns false. I just checked on my PostGIS 3.2 build and it indeed returns false.

However ST_Distance returns 0

SELECT ST_Distance(
		'SRID=4326;LINESTRING(-43.23456 72.4567,-43.23456 72.4568)'::geography,
		'SRID=4326;POINT(-43.23456 72.4567772)'::geography
		);

Even _ST_DistanceTreet returns 0

SELECT _ST_DistanceTree(
		'SRID=4326;LINESTRING(-43.23456 72.4567,-43.23456 72.4568)'::geography,
		'SRID=4326;POINT(-43.23456 72.4567772)'::geography
		);

However _ST_DistanceUncached returns a small number, so perhaps that is what ST_Intersects is using

SELECT _ST_DistanceUncached(
		'SRID=4326;LINESTRING(-43.23456 72.4567,-43.23456 72.4568)'::geography,
		'SRID=4326;POINT(-43.23456 72.4567772)'::geography
		);

returns - 1.4148932702941524e-09

same answer with PostGIS 3.1.2

Change History (0)

Note: See TracTickets for help on using tickets.