ASP VBScript Details :: Search Zip Code Radius

This thread was displayed: 536 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Nii Okunor
10-16-2006 16:48:17 GMT +2

Hello,

I am in the process of building a website for a small business franchise. I am done except for one thing: I know how to create search module for searching databases...however I dont know how to create a search module whereby a potential client for instance, will put in their zip code to find one of the franchise locations within a certain raduis.

To elaborate more, if you are on let's say...McDonalds website, you can search for a McDonalds location near you by typing in your zip code, and it will pull within a certain raduis of your zip code, all existing McDonalds franchises.

This is exactly what I would like to incorporate in the small business franchise website which I am building. Any help is welcome. I appreciate it.

Thanks.

Back | Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
10-16-2006 17:43:47 GMT +2

Hello,

You can do this, but it will require some hand coding, as none of our extensions support this.

One way to do this is to store each zip code together with it's latitude and longitude. This way, you can compute the distance between 2 zip codes using, for example, the Spherical law of cosines:

d = acos(sin(lat1).sin(lat2)+cos(lat1).cos(lat2).cos(long2−long1)).R

where R = earth's radius (mean radius = 6,371km). For more information on this forumla, please see this page. Once you have the distance between them, you know if they are in the same radius or not.

Regards,
Razvan RACASANU

Reply | Quote | Top
Nii Okunor
10-16-2006 19:13:04 GMT +2

Gosh Thanks. You always come through for me. I bought a database with all U.S zip codes and it has the long/lat coordinates. In my case if I want to pull all franchises within 30 miles, I will create my recordset to show only anything within 30 miles based on the entered zip code from the website using the formula you gave me. Please let me know I understand the concept correctly. I will also check out the website you attached.

Thank you.

Reply | Quote | Top
Nii Okunor
10-18-2006 21:08:15 GMT +2

RAZVAN,

IT WORKS!!! THANK YOU, THANK YOU, THANK YOU!

Reply | Quote | Top
Sign In
Sign In to see your information.
© Adobe Systems Romania. All rights reserved.