Opened 2 years ago

Closed 14 months ago

Last modified 14 months ago

#3573 closed defect (fixed)

Operator <<->> incorrectly calculates m distance

Reported by: dbaston Owned by: pramsey
Priority: medium Milestone: PostGIS 2.4.0
Component: postgis Version: 2.2.x
Keywords: Cc:

Description (last modified by dbaston)

When computing the m-distance between points and lines, the m ordinate of the first geometry is ignored.

SELECT 'POINT M (0 0 100000)'::geometry <<->> 'LINESTRING M (0 0 5, 0 1 6)'::geometry AS dist;
 dist 
------
    5


SELECT 'POINT M (0 0 1e9)'::geometry <<->> 'LINESTRING M (0 0 5, 0 1 6)'::geometry AS dist;
 dist 
------
    5

Change History (9)

comment:1 Changed 2 years ago by dbaston

Resolution: fixed
Status: newclosed

Corrected in trunk at r14939, 2.2 at r14940

comment:2 Changed 2 years ago by dbaston

Description: modified (diff)

comment:3 Changed 2 years ago by dbaston

Resolution: fixed
Status: closedreopened

Reopening, because the test case I added fails on Postgres < 95. Presumably the operator should produce identical results regardless of PG version?

comment:4 Changed 2 years ago by robe

No. I think the <<->> in 9.5+ returns tru distance rather than centroid box distance. Though I see our docs don't mention it which they should:

http://postgis.net/docs/manual-2.2/geometry_distance_centroid_nd.html

All the old centroid box KNN operators use recheck in 9.5+

comment:5 Changed 2 years ago by strk

Yeah, that's going to become a very confusing issue, I'm afraid.

comment:6 Changed 2 years ago by strk

See how the tests for <-> are handled. The current all-red build badges table is alarming

comment:7 Changed 2 years ago by robe

Milestone: PostGIS 2.2.3PostGIS 2.4.0

comment:8 Changed 14 months ago by dbaston

Resolution: fixed
Status: reopenedclosed

comment:9 Changed 14 months ago by strk

That is r14942

Note: See TracTickets for help on using tickets.