[Rails] Re: Geocode for Ruby

Hasan Diwan hasan.diwan at gmail.com
Wed Dec 14 16:50:55 GMT 2005


Adam:
On Dec 14, 2005, at 7:38 AM, Dave wrote:

> Adam Denenberg wrote:
>>  Does anybody know of a good Geocode library for Ruby, similar to  
>> Perl's
>> Geocode::Postal, that i could use in my rail app? I need to do some
>> "within
>> 5 miles" calculations of zipcodes and i dont have a nice ruby (or  
>> gem)
>> utility to do it.

It doesn't read like you're doing strict geocoding here. To solve the  
"within 5 miles" of zipcode problem, you need are the coordinates  
extremities of said zipcode. Since latitude and longitude correspond  
to distance, you then need to obtain how many degrees correspond to  
your desired distance. You then merely need to check if the given  
address's coordinates fall into this range.
Cheers,
Hasan Diwan <hasan.diwan at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20051214/3332be9b/PGP.bin


More information about the Rails mailing list