RANN icon indicating copy to clipboard operation
RANN copied to clipboard

points to line distance

Open HughSt opened this issue 6 years ago • 0 comments

Hi, thanks for the nn2 function, it has transformed the efficiency of distance calculations for large datasets. I have a related problem, where I would like to calculate the distance from each point to the closest point on a line. I can convert the line to a set of coordinates and then run nn2, however, this is sort of cheating as it doesn't formally calculate distance to the line that connects each of those coordinates. I just wondered whether you were working on (or could be persuaded to! :)) a function to do this? At the moment dist2line from geosphere is the best option I have, but it is very slow, even if parallelized, on large datasets. I'm working on a function to first find the nearest line, then sample points along that line and run nn2, but its pretty inelegant...

Thanks again!

HughSt avatar Oct 24 '18 17:10 HughSt