[Rails] Re: Geocode for Ruby

Adam Denenberg straightflush at gmail.com
Wed Dec 14 17:12:58 GMT 2005


in my database i have zipcode, longitude, latitude, city name, state.  I
understand pretty much whats involved in calculating distance, but there are
a lot of factors involved in that formula so i was hoping that a library
already existed to do such things.  i have read thru Geocode::Postal in the
perl module and its pretty involved.

adam

On 12/14/05, Hasan Diwan <hasan.diwan at gmail.com> wrote:
>
> 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>
>
>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20051214/7b52b7f2/attachment.html


More information about the Rails mailing list