code: func (tx *Tx) Nearby(index, bounds string,
  	iterator func(key, value string, dist float64) bool) error {
  	if tx.db == nil {
  		return ErrTxClosed
  	}
  	if index == "" {
  		// cannot search on keys tree. just return nil.
  		return nil
  	}
  	// // wrap a rtree specific iterator around the user-defined iterator.
  	iter := func(item rtree.Item, dist float64) bool {
  		dbi := item.(*dbItem)
  		return iterator(dbi.key, dbi.val, dist)
  	}
  	idx := tx.db.idxs[index]
  	if idx == nil {
  		// index was not found. return error
  		return ErrNotFound
  	}
  	if idx.rtr == nil {
  		// not an r-tree index. just return nil
  		return nil
  	}
  	// execute the nearby search
  	var min, max []float64
  	if idx.rect != nil {
  		min, max = idx.rect(bounds)
  	}
  	// set the center param to false, which uses the box dist calc.
  	idx.rtr.KNN(&rect{min, max}, false, iter)
  	return nil
  }
docs: // Nearby searches for rectangle items that are nearby a target rect.
  // All items belonging to the specified index will be returned in order of
  // nearest to farthest.
  // The specified index must have been created by AddIndex() and the target
  // is represented by the rect string. This string will be processed by the
  // same bounds function that was passed to the CreateSpatialIndex() function.
  // An invalid index will return an error.
  // The dist param is the distance of the bounding boxes. In the case of
  // simple 2D points, it's the distance of the two 2D points squared.