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+1
th point of neighbourhood.
Thanks.