code: func (q *Quadtree) FindKNearestMatching(p *geo.Point, k int, f Filter, maxDistance ...float64) []geo.Pointer {
  	if q.root == nil {
  		return nil
  	}
  
  	v := &nearestVisitor{
  		point:          p,
  		filter:         f,
  		k:              k,
  		closest:        newPointsQueue(k),
  		closestBound:   q.bound.Clone(),
  		maxDistSquared: math.MaxFloat64,
  	}
  
  	if len(maxDistance) > 0 {
  		v.maxDistSquared = math.Pow(maxDistance[0], 2)
  	}
  
  	newVisit(v).Visit(q.root,
  		q.bound.Left(), q.bound.Right(),
  		q.bound.Bottom(), q.bound.Top(),
  	)
  
  	//repack result
  	result := make([]geo.Pointer, 0, k)
  	for _, element := range v.closest {
  		result = append(result, element.point)
  	}
  	return result
  }
docs: // FindKNearestMatching returns k closest Value/Pointer in the quadtree for which
  // the given filter function returns true. This function is thread safe.
  // Multiple goroutines can read from a pre-created tree.
  // This function allows defining a maximum distance in order to reduce search iterations.