Community
cancel
Showing results for
Did you mean:
Beginner
110 Views

## Data thinning

Hello,

Can someone recommend routine(s) that would help with data thinning based on Euclidean distance between points? The locations may be  e.g. latitudes and longitudes.

Thanks,

2 Replies
Black Belt
110 Views

I don't know of any such routines, but it appears to me that no routine is needed. Please expand on what you mean by "data thinning", and why you wish to use euclidean distance instead of geodesic distance.

If you really wish to use euclidean distance, use the elementary transformation from spherical polar coordinates to rectangular coordinates. If you only wish to rank items by distance, the distance2 is equally good and more convenient for sorting.

If the distances are large (relative to the radius of the sphere), you really should use the great circle distance since the flat-earth approximation is quite inaccurate. See the Wikipedia article on the Haversine Formula: https://en.wikipedia.org/wiki/Haversine_formula . Again, if ranking is the goal, it may be sufficient to rank by {sin(distance/diameter)}2 instead of the distances, You may also consider pre-computing and storing a table of haversines.

The distance calculation is more complicated if you wish to account for deviations from sphericity.

Beginner
110 Views