Finds the pairs of points within max_dist of each other with a grid of
cells at least max_dist wide, so that only points in neighbouring cells
are compared.
find_stop_pairs_within(lat, lon, max_dist, check_n_pairs)A data.table with the indices of the two points of each pair
(from smaller than to) and the distance between them, in meters.
Numeric vectors with the coordinates of each point, in degrees. Points without coordinates are ignored.
A number, in meters.
A function called with the number of pairs of points in neighbouring cells before they are listed, to check that they can be compared.