Database Reference
In-Depth Information
Fortunately,forPostGIS2.0,wecanleveragethedistanceoperators(
<->
and
<#>
)
to do indexed nearest-neighbor searches. This makes for very fast KNN searches
thatdon'trequireustoguessaheadoftimehowfarawayweneedtosearch.Why
arethesearchesfast?Thespatialindexhelps,ofcourse,butinthecaseofthedis-
tanceoperator,weareusingthestructureoftheindexitself,whichishierarchical,to
very quickly sort our neighbors.