Opened 8 years ago

Closed 7 years ago

Last modified 7 years 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 by dbaston, 8 years ago

Resolution: fixed
Status: newclosed

Corrected in trunk at r14939, 2.2 at r14940

comment:2 by dbaston, 8 years ago

Description: modified (diff)

comment:3 by dbaston, 8 years ago

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 by robe, 8 years ago

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 by strk, 8 years ago

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

comment:6 by strk, 8 years ago

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

comment:7 by robe, 8 years ago

Milestone: PostGIS 2.2.3PostGIS 2.4.0

comment:8 by dbaston, 7 years ago

Resolution: fixed
Status: reopenedclosed

comment:9 by strk, 7 years ago

That is r14942

Note: See TracTickets for help on using tickets.