Forum: Ruby on Rails Geocode for Ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Adam D. (Guest)
on 2005-12-14 17:09
(Received via mailing list)
Hey,

 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.

any help would be appreciated.

thanks
adam
Dave (Guest)
on 2005-12-14 17:38
Adam D. wrote:
> Hey,
>
>  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.
>
> any help would be appreciated.
>
> thanks
> adam


Adam - I don't have any "libraries" per-se, but my sites currently are
built on rails and use geocoding to do some proximity querying.  I have
some documentation at http://www.geocodeamerica.com/home/proximity that
might be helpful (its talks about integrating proximity queries in with
google maps, but does have some ruby code at the end).  Feel free to
email me with any questions.

Dave
http://www.favoriterun.com
Hasan D. (Guest)
on 2005-12-14 18:51
(Received via mailing list)
Adam:
On Dec 14, 2005, at 7:38 AM, Dave wrote:

> Adam D. 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 D. <removed_email_address@domain.invalid>
Adam D. (Guest)
on 2005-12-14 19:15
(Received via mailing list)
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
This topic is locked and can not be replied to.