Welcome!

ColdFusion Authors: Maureen O'Gara, Hovhannes Avoyan, Yakov Fain, Pat Romanski, Liz McMillan

Related Topics: ColdFusion

ColdFusion: Article

Building a Zip Code Proximity Search with ColdFusion

The new challenges and possibilities are numerous

I Need Reliable Data
Once my application underwent more testing, I found that the sample database was missing some zip codes. I'm not sure where Robert obtained his data, but it definitely was not current. So off I went on another Google search, this time for a zip code data vendor. I ended up purchasing the data I needed for a whopping $5.00. That's right, only five bucks! I bought it from a small company called Team Red Line at http://teamredline.com/zc/default.asp. It included 42,492 records, about 44% more data. I also found that this new data included zip codes for many armed forces locations. However, none of our resellers are located in those zip codes. In addition, these zip codes don't contain any latitude and longitude values, so distances can't be computed. I put a check in for this case, and displayed a friendly error message to the user if he or she entered one of these special zip codes. Feel free to check out the finished Reseller Locator on my company's Web site at www.securecomputing.com/partner_locator.cfm.

Now It's Your Turn
As I mentioned earlier, I've used many store locator applications. These usually display the mileage from your zip code for each store location. This distance value was not needed in the Reseller Locator application, but you may want to implement it in your situation.

I also didn't need to output a graphical map, which usually shows an "X" on your location and little icons for each of the store's locations, or perhaps a link to a mapping Web site for driving directions, etc. It would be very cool to integrate the locations into mapping APIs at Google or Yahoo. The new challenges and possibilities are numerous.

I'm sure your mind is spinning right now as you think about where you might put this new technique to practice, so I'll end here and let you get to work. Make sure you visit the webmonkey.com URL and download Robert's code to get started. Keep me posted if you've put any of this knowledge to use or have any helpful tidbits. I hope a few developers out there can apply the zip code proximity search to their Web applications in exciting new ways. Good luck!

Reference

More Stories By Troy Pullis

Troy Pullis works as a senior Web developer for Secure Computing Corporation (www.securecomputing.com) and also manages the Twin Cities ColdFusion Users Group (www.colderfusion.com). He is a Certified Advanced CFMX Developer. Back in 1999, Troy shifted his client/server Java programming career to focus on the Internet boom. He immediately started using ColdFusion, began attending CFUG meetings, and has never looked back.

Comments (3) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
CFDJ News Desk 12/15/05 06:33:24 PM EST

Building a Zip Code Proximity Search with ColdFusion. Recently I was tasked with improving our Web site's Reseller Locator application. This tool helps potential customers in the U.S. find a product reseller in their state. By choosing a state from a drop-down box, a listing of all resellers located in that state is displayed.

CFDJ News Desk 12/15/05 06:03:25 PM EST

Building a Zip Code Proximity Search with ColdFusion. Recently I was tasked with improving our Web site's Reseller Locator application. This tool helps potential customers in the U.S. find a product reseller in their state. By choosing a state from a drop-down box, a listing of all resellers located in that state is displayed.