From 5c87f32b118bc0a59746c45c31cbdf6835b58a60 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 18 Feb 2015 16:32:20 +0000 Subject: [PATCH] Reword documentation for <-> operator Hopefully it's now less confusing git-svn-id: http://svn.osgeo.org/postgis/trunk@13233 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_operator.xml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/reference_operator.xml b/doc/reference_operator.xml index 7f2da763e..a137db923 100644 --- a/doc/reference_operator.xml +++ b/doc/reference_operator.xml @@ -1068,9 +1068,10 @@ select 'LINESTRING(0 0, 1 1)'::geometry ~= 'LINESTRING(0 1, 1 0)'::geometry as e <-> - Returns the distance between two points. For point / point checks it uses floating point accuracy (as opposed to the double precision accuracy of the underlying point geometry). For other geometry types - the distance between the floating point bounding box centroids is returned. Useful for doing distance ordering and nearest neighbor limits - using KNN gist functionality. + +Returns the 2D distance between the centroids of A and B bounding +boxes. + @@ -1096,10 +1097,13 @@ select 'LINESTRING(0 0, 1 1)'::geometry ~= 'LINESTRING(0 1, 1 0)'::geometry as e Description - The <-> operator returns distance between two points read from the spatial index for points (float precision). For - other geometries it returns the distance from centroid of bounding box of geometries. Useful for doing nearest neighbor approximate distance ordering. + +The <-> operator returns the 2D distance between the +centroids of the bounding boxes of two geometries. Useful for doing +nearest neighbor approximate distance +ordering. - This operand will make use of any indexes that may be available on the + This operand will make use of 2D GiST indexes that may be available on the geometries. It is different from other operators that use spatial indexes in that the spatial index is only used when the operator is in the ORDER BY clause. Index only kicks in if one of the geometries is a constant (not in a subquery/cte). e.g. 'SRID=3005;POINT(1011102 450541)'::geometry instead of a.geom -- 2.40.0