Opened 2 years ago

Last modified 2 years ago

#5095 new defect

Unexpected ST_DWithin result when using geography

Reported by: satoshi Owned by: pramsey
Priority: medium Milestone: PostGIS Fund Me
Component: postgis Version: 3.2.x
Keywords: Cc:

Description

Hello,

This query:

SELECT ST_DWithin(
  ST_Buffer('SRID=4326;LINESTRING(7.1670005 45.9968257,7.1670216 45.9969537,7.1670216 45.9971326, 7.1670484 45.9972789, 7.1671905 45.9974074, 7.1672844 45.9974801, 7.1659165 46.0005209, 7.1653103 46.0010221, 7.1652359 46.0013015)'::geography, 1.0),
  'SRID=4326;POINT(7.1672844 45.9974801)'::geography,
  0.0
);

Returns FALSE. Note that the point that is passed as the second parameter to ST_DWithin is part of the LINESTRING passed in the first parameter, so I expect it to return TRUE.

When removing the first or last point from the LINESTRING, then it correctly returns TRUE.

When using geometry instead of geography and using 0.0000105 for the buffer (which is roughly 1 meter at that latitude), then it correctly returns TRUE.

I think this is a bug?

Thank you,

Dario

Change History (2)

comment:1 by robe, 2 years ago

Milestone: PostGIS 3.3.0PostGIS 3.2.2

comment:2 by robe, 2 years ago

Milestone: PostGIS 3.2.2PostGIS Fund Me

satoshi I talked with Paul about this. Sadly it's one of those tolerance issues that is a bug but hard to fix. It's on his plate to do a significant rewrite of geography to introduce higher precision math and so this can't be easily fixed until that work is done..

I'm going to push this to the Fund me bucket since it's something we want to fix, but very difficult.

Note: See TracTickets for help on using tickets.