Closed vagmi closed 6 years ago
I don't think there is a really great (efficient) way to do this. I would suggest projecting your points to the plane first using mercator or something, then projecting back once you find the point. I'm pretty sure that'll work reasonably well for the values in your test.
You can do this using geo.Mercator.Project
and geo.Mercator.Inverse
in this package.
I needed this on a project I was working on where I need to choose clusters based on how close they were and the users were given the option to tune the distance. The max squared distance was arbitrary and is difficult to reason with.