Real Estate Forums

Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here.

Reply
 
Thread Tools Display Modes
Old 03-17-2007, 11:47 AM
smartyguy smartyguy is offline
New real estate webmaster
 
Join Date: Mar 2007
Posts: 3
smartyguy is on a distinguished road
Default zipcode distance calculation

I need to list a bunch of addresses of homes and property. I would like to allow the user to input their zipcode and list the matches by the closest to farthest.

This way they can enter a cental point and get all matches in a certain radius.

Does ayone know of a program or method that this can be accomplished. I need to add it to an existing program, so I need something simple that wont take up too much server resources. My isp limits me to 10% cpu useage.

Any help would be apreciated.
Reply With Quote
Old 03-29-2007, 10:26 AM
Shap_AF Shap_AF is offline
New real estate webmaster
 
Join Date: Mar 2007
Posts: 5
Shap_AF is on a distinguished road
Default Re: zipcode distance calculation

How about this? scriptsearch.com/cgi-bin/jump.cgi?ID=4509

Last edited by webmaster; 04-06-2007 at 10:51 PM.
Reply With Quote
Old 04-06-2007, 07:01 PM
RESynergy RESynergy is offline
Real Estate WebMaster
 
Join Date: Nov 2006
Posts: 109
RESynergy is on a distinguished road
Default Re: zipcode distance calculation

We did something similar years ago but the details are a little vague now. From what I remember, there are some data lists that correlate the zip code to a longitude - latitude value. From there it is fairly simple math to figure out what zip codes fall within that range. I remember we might have spent an hour in Google looking for the right db . Maybe try "longitude latitude zip codes" in a search?
Reply With Quote
Old 04-09-2007, 01:36 AM
REW Fergus's Avatar
REW Fergus REW Fergus is offline
Real Estate Webmasters Staff
 
Join Date: Aug 2006
Location: Nanaimo, BC
Posts: 588
REW Fergus is on a distinguished road
Default Re: zipcode distance calculation

Google Maps can geocode a zip code to latitude and longitude. I haven't tried running the same query by the Google API geocoder, but it should work. The expensive part of the transaction is doing the math to find the latitude and longitude intersections of matches within the specified radius.
__________________
Fergus Gibson
realestatewebmasters.com
Reply With Quote
Old 05-03-2007, 02:06 PM
flann flann is offline
New real estate webmaster
 
Join Date: May 2007
Posts: 8
flann is on a distinguished road
Default Re: zipcode distance calculation

the math to figure out the distance between two points on a sphere (Mother Earth) is called the haversine function. I wrote a program that uses Google API geocoder to get the lat and long, then run it through the haversine function to get the distance in miles.

here's an example... dealer locator
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



For our members

Main Sections

IDX Coverage Areas

Spiders Welcome

All times are GMT -7. The time now is 08:56 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.