The kdtree package can construct, modify and search kd-trees.
https://github.com/stefankoegl/kdtree.git
stable