pysal.lib.cg.fast_knn

pysal.lib.cg.fast_knn(pts, k, return_dist=False)[source]

Computes k nearest neighbors on a sphere.

Parameters:
pts : list of x,y pairs
k : int

Number of points to query

return_dist : bool

Return distances in the ‘wd’ container object

Returns:
wn : list

list of neighbors

wd : list

list of neighbor distances (optional)