[PostGIS] #6026: Distance operator <-> returns "tuple order" error

PostGIS trac at osgeo.org
Mon Apr 6 14:58:29 PDT 2026


#6026: Distance operator <-> returns "tuple order" error
----------------------+----------------------------------------------
  Reporter:  dirc     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:
 Component:  postgis  |    Version:  3.5.x
Resolution:           |   Keywords:  distance, operator, tuple, order
----------------------+----------------------------------------------
Comment (by pramsey):

 So, doing a little digging into the debugger, I find that:

 * The index distance between the bounds of the polygon and the point is
 exactly 778.
 * Meanwhile, the "exact" distance between the polygon and the point is...
 less.

 {{{
 SELECT ST_Distance(
  'LINESTRING(132700 490000, 133894.531 490000)',
  'POINT(133718 489222)'
 );

     st_distance
 -------------------
  777.9999999999999
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/6026#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list