computer science, math, programming and other stuff
a blog by Christopher Swenson

US ZIP Code Data

Recently, I was thinking to myself, "Where do all of these wonderful sites on the web get information to map cities, towns, and US ZIP codes to actual locations?" I then though, "How much do they pay?" In reality, I don't know the answer, though there seem to be many companies you can pay for the information.

The best data I could find easily was from the US Census, though it is in a terse, fixed-column format. Clearly then, the next step is to read it into a database.

So, naturally, I created a small Ruby script to do just that. If you are interested in such things, you can view it over at github.

The next question I am curious about is calculating the distance between two points on the Earth's surface given their latitude and longitude pairs. This isn't trivial, but it shouldn't be too hard to get a rough estimate.