How to use the Spatial interface
masterTo store custom objects in an R-tree, your type must implement the Spatial interface by providing a Bounds() method that returns a *Rect.
type Spatial interface {
Bounds() *Rect
}type Thing struct {
where *Rect
name string
}
func (t *Thing) Bounds() *Rect {
return t.where
}