1

I have a set of points on a map.

For each point (say 'a'), i want to obtain n (say 5) nearest neighbours that surround the point.
Currently, I make a list of euclidean distance from 'a' to other points .
Then I sort the list and choose 'n' smallest values .

I found that this way, it sometimes happen that all closest points will form a polygon without containing a.

Can you suggest a way to choose n points that surround a.

I know the method to determine if a point lies in polygon. I am not able to decide which closest point to discard when I include n+1th point of neighbourhood.

Thanks.

Mike Doe
  • 16,349
  • 11
  • 65
  • 88
lxuser
  • 11
  • 3

0 Answers0