Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a Search By Distance Form

Status
Not open for further replies.

kammsba

MIS
Apr 9, 2003
3
US
I'd like to build a search form which allows members to get results of school districts within so many miles of their own district. Is this possible? How do I start? Thanks!
 
kammsba, what kind of dB will you be using?

The easiest way would be asking the users for their zipcode and then create a query that will only return results of school districts that are within a certain range (in terms of miles) from the users zipcode.

And to avoid asking for the users zipcode over and over again, use CFCOOKIES or something that "remembers" the users zip.

Hope this helps you.

[sub]
____________________________________
Just Imagine.
[sub]
 
Just out of curiosity, how would you go about determining the mileage between each zip code? I've often wondered how this was done.



Hope This Helps!

Ecobb

"My work is a game, a very serious game." - M.C. Escher
 
you might try searching by zip codes...
here is some info on how to do this.....



------------------------------------------------------------------------------
brannonH
if( !succeed ) try( );
 
The first thing you need is a database that geocodes ZIP codes, that is, assigns some version of an X and Y coordinate to the ZIP code record. This is the "ballpark" method; ZIP areas vary in size. You can use the simple right triangle distance formula, or introduce the fudge factors for latitude and longitude if you want get fancy.

You'll still have to disclaim your tool with "as the crow flies", because you're not presenting a true point-to-point.

HTH,

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top