Use bounding box to optimize distance query