views:

40

answers:

1

I have a database of 20k+ cities with latitude and longitude and I need to make lot of nearest point queries (which city is the nearest to certain lat,long point) against this dataset.

I guess an R-Tree or QuadTree would be a perfect data structure for this, but I haven't been able to find a working ruby implementation. Do you know any?

A: 

I've found the kd-tree gem which helped me solve the above task

esad