On 03/06/2010, at 1:45 PM, Keith Pitt wrote:
> We wrote a plpgsql function that made it easier for us to find locations 
> within a certain radius.

This functionality is available via the PostgreSQL "earthdistance" module. Your 
"km_between_lat_long" function can be replaced with:

    earth_distance(ll_to_earth(lat1, lon1), ll_to_earth(lat2, lon2))

I'm unsure whether that would be faster or more accurate than what you're 
doing, so you'd need to test it.


Cheers,

Nathan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to