Approximate Computation of Distance-Based Queries