Input:
point = (lat, long)
places = [(lat1, long1), (lat2, long2), ..., (latN, longN)]
count = L
Output:
neighbors
= subset of places
close to the point
. (len(neighbors)=L
)
Question: Can I use kd-tree for quick nearest-neighbors lookup for points with latitude and longitude? (For example, implementation in scipy)
Is it necessary to transform the geographical coordinates (latitude and longitude) of the point in the coordinates x,y?
Is it the best way to solve this?
scikit-learn
provides a BallTree
class that supports the Haversine metric. See also this SO question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With