The purge demonstration does not find the nearest neighbor, but finds the quadrant points contained in this rectangle. (Try to clear the empty rectangle and not necessarily visit the nearest neighbors.)
I was looking for an example that effectively finds the closest neighbor in the quadrant at an arbitrary point - see http://bl.ocks.org/patricksurry/6478178
patricksurry
source share