2

I know that there are a lot of ways to do geo proximity searches using databases, but if I want to quickly geo search a large array of [lat,lng] in memory, what's the most efficient data structure to store and search that data? Is there some sort of in memory r-tree library I should be using, or should I just iterate through for all but the largest of arrays?

The geo searches I would be doing would be closest to a point and a within radius.

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
  • the "within radius" one results in a filter()ed sub-set of the input array, so that's easy enough to do. the "closest to a point" can also be accomplished with a single iteration of the list, reduce()ing it to the min offset. – dandavis Apr 12 '15 at 03:36
  • grid files work surprisingly well in many cases. you won't find a library, but build them low-level into your code and *tune* them for your data. – Has QUIT--Anony-Mousse Apr 12 '15 at 09:12

0 Answers0