Testing Quadtree
================

Make an instance

    >>> from quadtree import Quadtree
    >>> index = Quadtree((-180, -90, 180, 90), maxdepth=16)

Add 4 items, the last one a point

    >>> index.add(0, [-106, 39, -105, 40])
    >>> index.add(1, (-100, 25, -95, 30))
    >>> index.add(2, (40, 50, 45, 55))
    >>> index.add(3, (-105, 33))

Prune

    >>> index.prune()

Find likely items

    >>> [n for n in index.likely_intersection([-110, 30, -100, 45])]
    [0, 1, 3]
    >>> [n for n in index.likely_intersection([10, 40, 40.05, 60])]
    [2]

We get a hit for the next bounding box even though it doesn't explicity
intersect with the item -- it does intersect with the tree node containing
the item.

    >>> [n for n in index.likely_intersection([-110, 35, -108, 45])]
    [0]
   
Tree structure

    >>> tree = index.struct()
    
Visualize

    >>> from quadtree.viz import render_graph
    >>> render_graph(tree, 'quadtree.png')
    

