Categories
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
UPSTATEDAVE
13900
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.