Skip to content

Instantly share code, notes, and snippets.

View mapsm12's full-sized avatar
🏠
Working from home

mapsm12 mapsm12

🏠
Working from home
View GitHub Profile
@tompaton
tompaton / kdtree.py
Created March 10, 2011 00:15
Python kd-tree spatial index and nearest neighbour search
#!/usr/bin/env python
# kd-tree index and nearest neighbour search
# includes doctests, run with: python -m doctest kdtree.py
class KDTree(object):
"""
kd-tree spatial index and nearest neighbour search
http://en.wikipedia.org/wiki/Kd-tree
"""