Linux Solutions for Zip Codes and Congressional Districts?
davidmcn asks: "There is an overabundance of solutions available for the Microsoft brand of operating systems which allow the mapping of zip-codes to congressional districts. However, I work for a small consulting firm that works primarily with Linux/Apache/PHP/MySQL, and would like to find a way to take address information, and create mailings based on Congressional Mappings. Does anyone know of a solution that is available for a linux enviroment? Even something as simple as a list of Congressional Districts and all zip codes underneath them would suffice."
"take address information, and create mailings"
You won't find much in the way of open source software designed to enable you to create privacy invasive databases or spam your special interest group's message.
You just opened up a vipers nest as far as that question is concerned here on slashdot. Privacy invasion and spam are extreme hot button issues here.
You want to do them both. Go spend the money with microsoft. They love people like you.
If voting were effective, it would be illegal by now.
"linux solution" = gimme something for free
I ran "zip codes" "congressional districts" through Google and got back a bunch of links.
This place seems to have zip code info sliced several ways, including congressional districts, for a fee.
This place seems to specialize in providing info like this as well...
</karma whoring>
With the yearly redistricting that some/all states do, it's probably easiest to purchase the info. Perhaps even from the Post Office themselves... congressional district info seems to be a component field that they track anyway... call the National Customer Support Center at 1-800-238-3150. Hours of operation are 7:00 AM through 5:30 PM CT.
find a way to take address information, and create mailings based on Congressional Mappings.
So you want a solution to more efficiently send me junk mail and spam? Yeah, I'll get right on helping you out.
Need Free Juniper/NetScreen Support? JuniperForum
Congress Merge offers tables linking zip codes to congressional and/or state legislative districts and congressional databases Data can be provided either as a text (flat) file or an Access database
So there you go.. A flat text file could easily be imported into mysql surely.
I don't get it. They guy wants to map some zip codes to congressional districts. What on earth is the problem with that? Maybe he has a database with the zip codes of people earning over 60K per year. He wants to do a statistical analysis of how those people are distributed according to congressional district, and draw some conclusions about income and voter habits. I fail completely to see the problem with this.
Maybe the database of zip codes has been bought from acme-evil-spam-company, but, oh shit, maybe just maybe it hasn't!! Maybe those people all happily gave their zipcodes and salaries in return for the chance to win a new car. Maybe they gave that information because it only took them 10 seconds to do and they felt like helping out some research company.
Jeez, lighten up will you.
-----
"Great, help you out, you're just a dirty rotten spammer that wants to build a big fat spamdatabase, you spamlord!"
Did any of you guys read the story? What possible use could it be for a spammer to know what Zip code is in which congressional district, or vice versa? Give the guy a break, not everyone is malicious.
And what's up with "you're using Linux, so that means you're just out to get a free lunch"? Even if that were true, who cares about peoples motivation for using Linux, or Windows for that matter.
There's a little branch of the U.S. Government called the Census. Maybe you've heard of them. They have these wonderful little maps that break the U.S. up based address ranges and ZIP codes. You can order TIGER files from several vendors (so that you have simple vector-based maps of all the ZIP codes and address blocks), or you can get it in database format.
It's available for free via anonymous FTP. Try poking around http://www.usgs.gov where you'll find those, plus other free maps.
At least I won't have until the UK becomes the 52nd (or whatever) state...
In case anyone is interested in how this works outside of the US...
In the UK the administrative regions don't map to postcodes (which is fairly insane). However, as you can't post census forms to 'John Q. Public, Borough of Wandsworth', the census bureau take care of producing a mapping every ten years.
This product is the 1991 copy, quite cheap at only £740 for corporate use (compared to other map data)
This one is from the most recent census and is the only mapping that covers the new boundaries in Scotland. A bit steep at £8000-odd. I say steep, because for roughly the same price, the Ordnance Survey will sell you (at the top whack corporate rate) the source data this is based on, complete with geometries for every postcode and every region. Doh!
If you just need something to narrow down someones administrative area from their postcode (to a handful at most), on the very very very cheap...Download this map of the regions and this map of the postcodes, overlay them in photoshop, and figure out the mapping for yourself.
How is a zip code going to help a spammer? The poster is looking to send junk snail mail, and frankly I'm more in favor of that because you have to spend time sorting your database, printing your mail, sorting your mail, trucking it down to your local bulk mail center, and paying postage.
This sig no verb.
Keeping an individual specific private database is Privacy invasion.
No it's not. Could somebody call you and demand that they be removed from your rolodex?
Privacy invasion...that's just silly.
Political database... what the hell is this? 1984?
No, more like 1930; databases have always been essential to getting elected. It's just that they used card catalogs back then. Nobody has ever been elected to Congress without an ass-kicking database. If you don't know that, you ought not be making political accusations.
-Waldo Jaquith
The real need is to have a spatial representation for geographic region information. You are trying to translate between two specific maps: zip codes to congressional districts. Actually, 5-digit zip codes are probably not accurate enough (districts cut across zipcode zones) and then you get into the realm of geocoding which attempts to translate a real world address into latitude, longitude and accuracy.
In the proprietary realm, there are products like Mapinfo and Mapmarker for address geocoding and zoning. Oracle has a spatial option which creates object types in the database for storing arbitrary sets of points and polygons and querying based on their intersection/overlap properties.
What you are are looking for is freely provided by the census in the form of TIGER/line files. TIGER Data contains all the census data from 2000. You can find an overview here: Tiger Overview
Of course, you could simply alter the letter for multi-district zip codes, urging the voter to vote for whichever of these candidates is on their ballot, but that might seem awkward.
Generally, politicians don't campaign very heavily in this town because of the split, and instead concentrate their campaigning in places where all the voters are in the "right" district.
If you rely just on general mailing addresses, be aware that many folks have a mailing address different than there residence and voting address. I've almost always had a P.O. Box, and when I lived in San Francisco and Oakland, the zip code for the PO Box was different from my home. If your list may include office addresses, then things get even more complicated, due to commuting patterns.
Finally, the U.S. post office often assigns zip codes based on their carrier routes, and not based on political boundaries. Thus, a number of homes in unincorporated areas adjacent to Danville and San Ramon, California, in the Tassajara Valley, are politically in those Contra Costa County political districts, yet they share my Pleasanton zip code, which is in Alameda County.
-- http://www.MarkWelch.com/ Pleasanton California
ZipLoc a PHP class can be used in conjunction with the data provided on US gov census site?
Congresional Districts don't map to 5 digit zip codes, but they do map to 9 digit zips codes (Zip+4). Every mailing address has a 4 digit extension to its zip code. Any giving 4 digit extension will only cover a couple of delivery stops. That means apartment complexes have several 4 digit extension just for them. Any given extention will cover a half dozen unique delivery addresses, at the most. So you can map congresion districts to 9 digit zip codes.
You can find the 4 digit extention to your zip code here :
http://www.usps.com/zip4/
Using the 4 digit extension also seems to help mail arrive a *little* faster, as it tells the Post Office almost exactly where it needs to go.