<<->>
Name
<<->> — Returns the n-D distance between the centroids of A and B bounding boxes.
Synopsis
double precision
<<->>
(
geometry
A
,
geometry
B
)
;
Description
The
<<->>
operator returns the n-D (euclidean)
distance between the centroids of the bounding boxes of two geometries.
Useful for doing nearest neighbor
approximate
distance ordering.
![]() |
|
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 |
Availability: 2.2.0 -- KNN only available for PostgreSQL 9.1+