Categories

  • All Discussions
  • Hottest Topics
  • My Discussions
  • Specific Beers
  • Specific Brewers
  • General Beer Talk
  • Website
  • Non-Beer Talk
  • Industry News
  • Beer Events
  • Beer and Food
  • BeerPal Polls
  • Unreplied
  • Popular All Time

FLASHPRO
49720

FLASHPRO
49720

Zip Codes

Website Comments by FLASHPRO

I'm proud to say that I added a search by zip code to the Beer Compass today. It was a pain in the ass and a lot more work went into it than I thought it would take. I had to download a text file with all the zip codes of the united states from a government website. Otherwise you have to pay $99+ to buy pre-formatted databases. So then I spent a few hours extracting the database into a usable format before I could do anything. The trick is that each zip code has its longitude and latitude on Earth, down to 6 decimal places. Then with a bunch of trig functions the distance between any two zip codes could be found. My next problem was it was taking 32+ seconds to search all the retailers, but I found a way to chop it to 0.5 seconds, phew. Finally, I let the user choose their own radius in miles to search from and with an array the results are now listed in order of distance. Man, I'm burned out. Check it out!


20 years ago
# 1
# 1

I guess this is a BP option I never clicked until I just found this post. Do BP's actually use this?

19 years ago
# 2
# 2

FLASHPRO
49720

In Reply To #2 Good question! It would be a useful tool if everyone added their local establishments.

19 years ago
# 3
# 3

Good work Thanks I use the zip code search often. I like to use the compass feature to research beer retailers + pubs before I travel. It gives me a starting point for beer hunting.

19 years ago
Sign up to participate!