Say you have a list of gps coordinates for every restaurant on earth, and you have the coordinates for your current location. You want to find the closest n restaurants. Obviously it could take forever to search through an unsorted list, they need to be indexed somehow.
How should they be stored/indexed to be able to find the closest ones easily? I was thinking some kind of a double dictionary by latitude and longtitude or a double hash of some kind, but I'm sure this problem has been tackled before, and I'm wondering if there's an "optimal" solution.