Forum: Ruby on Rails Zipcode Search

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.
33bb150cf13d87bce4e80569ca317647?d=identicon&s=25 Siva Jagadeesan (Guest)
on 2006-02-03 09:31
(Received via mailing list)
Is there any package that I could use for zipcode search.

I want to display schools that near a particular zipcode. I have no idea
how
to do this. It will be great if anyone can point me where I could find
info

--
Rgds,
--Siva Jagadeesan
http://www.varcasa.com/
Education Through Collabration
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2006-02-03 10:49
(Received via mailing list)
On 2/3/06, Siva Jagadeesan <sivajagdev@gmail.com> wrote:
> Is there any package that I could use for zipcode search.
>
>  I want to display schools that near a particular zipcode. I have no idea
> how to do this. It will be great if anyone can point me where I could find
> info

Hm.  It's probably lots easier to find a school IN a particular zip
code instead of near one.  Would that be good enough?

Joe
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 Adam Denenberg (Guest)
on 2006-02-03 15:05
(Received via mailing list)
Do you have longitude/latitude information?  I can send you the
proximity query but you need the longitude and latitude in order to
find proximity zips.

Basically what you do is find the zip code in question.  Then find all
the zipcodes X miles away and then find all the schools in that range
of zipcodes.

query looks like this

 @places = Place.find_by_sql ["select p.* from places p where ((3963.0
* acos(sin(p.latitude/57.2958) *
       sin(?/57.2958) +  cos(p.latitude/57.2958) * cos(?/57.2958) *
        cos(?/57.2958 - p.longitude/57.2958))) < ?)", lat, lat, lon,
distance]

check out this guys site, he really helped me out.

http://www.geocodeamerica.com/home/proximity

good luck
adam
97a7959f0d9e6c90ddae200520e93067?d=identicon&s=25 Damon Clinkscales (Guest)
on 2006-02-03 16:39
(Received via mailing list)
Adam Denenberg <straightflush@...> writes:

> Do you have longitude/latitude information?
This was posted yesterday.  It contains a migration to give you
lat/long/zip
mapping.

http://www.jvoorhis.com/articles/2006/02/02/geocod...

-damon
33bb150cf13d87bce4e80569ca317647?d=identicon&s=25 Siva Jagadeesan (Guest)
on 2006-02-03 21:52
(Received via mailing list)
This is great guys. I will go through this and let you guys know abt it.


--
Rgds,
--Siva Jagadeesan
http://www.varcasa.com/
My First Rails Project.
Education Through Collabration
This topic is locked and can not be replied to.