Slashdot Mirror


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."

30 comments

  1. No by Perdo · · Score: 0, Flamebait

    "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.

    1. Re:No by pediddle · · Score: 3, Insightful

      Privacy invasion? I fail to see how the zip codes and Congressional Mappings aren't public information. All he needs is a list of that information in a single place.

      Presumably he already has a database of people addresses. All he needs to do is figure out which congressmen correspond to each of those addresses, based on their zipcodes. Nobody's asking for a list of the addresses, congressmen, and sexual orientation of every person in the country.

      Furthermore, even if you consider his mailings as "junk mail", how is it an invasion of your privacy to recieve it? Unless he puts a little wireless camera in every envelope, the only bad thing that can come of it is a little more junk in the landfills.

      Really now.

      Alright, so junk mail is annoying. But from my impression of his question, this doesn't even sound like email spam. So what if it is? He's not scamming people, or increasing the size of anyone's penis. This would be a list where you specifically ask to recieve information about political, um, stuff.

      OK, so I'm making assumptions too. But hopefully you won't jump to such harsh and damning conclusions every time somebody mentions "zip code" and "mailing list" in the same sentence. There *are* legitimate reasons to want this.

    2. Re:No by Perdo · · Score: 3, Informative

      A zip code refrence is available at:

      http://www.house.gov/writerep/

      That is easy. I belive he wants a voter registration database for the districts themselves...

      Mass mailings are Spam.

      Keeping an individual specific private database is Privacy invasion. Can I call up his consulting firm and ask them what they know about me? Can I have myself removed? Would anyone realisticly opt-in to this? no. 99% would opt out.

      Walking into Kragen Auto Parts I'm pissed that I can't just pay for my parts and leave. No, they keep a damn database. They know everything they've sold me for the past 5 years. Problem is I've only benn shopping ther for 2 years. The database is cataloged by phone numbers. The jerkoff that had my phone number wrote bad checks all over town.

      So not only are there databases everywhere about me, most of them are entirely wrong. Kragen can't delete the database entry until they get paid. I get hasseled just because I want a battery.

      Databases are privacy invasive bullshit.

      Political database... what the hell is this? 1984?

      --

      If voting were effective, it would be illegal by now.

    3. Re:No by adolf · · Score: 4, Insightful

      True.

      But these same databases are what allows me, the typical mechanically-inclined consumer, to keep bringing back a set of brake pads and rotors every six months or so. This allows me to drive at stupid-fast speeds without having to worry that the brakes might not have enough friction material left to handle yet another triple-digit-to-zero stop, increasing the survival rate of the human species by an order of magnitude, I'm sure.

      Therefore, such databases are good for humanity.

      Also works with water pumps and thermostats, which for some reason are fundamentally troublesome on my vehicle. I get new ones every year or so, for free.

      Also works with spark plugs, wires, alternators, and a whole lot of other consumable (and not-so-consumable) items.

      And dig this: I don't need a receipt. I just show up and buy parts. When I'm done replacing them, hours, days, weeks, or months later, I just take them back in the same box and get refunded.

      Many times, the same part is made in the same place, with the same tools, but sold under different names with different warranties. I usually pick the long warranty.

      And, besides, it's nowhere near as scary as what collection agencies will do to you. These are just fucking car parts, the same quality of which is available down the street from a completely different retailer for about the same amount of money if things get too weird at a particular shop.

      And dig this, as well: The parts store I generally go to tracks by phone number, name, and address. It seems to be a pretty fool-proof way to go about things, unless an enemy of yours is walking around pretending to be you. And if that's happening, you've got more things to worry about than such annoyances as a weak car battery. [as an aside: the database has some sort of UNIX-like backend, controlled by plain dumb terminals, which is inarguably a boon for the human race. I can't imagine how tedious the process would be if it relied on a series of look, see, click, wait, type, look, see, click, wait repetitions under Windows.]

    4. Re:No by Anonymous Coward · · Score: 0

      Shut up, troll.

    5. Re:No by penguinboy · · Score: 2

      That is easy. I belive he wants a voter registration database for the districts themselves...

      How do you extrapolate that from the original request:

      "Even something as simple as a list of Congressional Districts and all zip codes underneath them would suffice."

  2. Translation by Anonymous Coward · · Score: 0

    "linux solution" = gimme something for free

  3. Some sources by dagnabit · · Score: 3, Informative



    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.

    1. Re:Some sources by Anonymous Coward · · Score: 0

      You do not need to purchase any information. It is all available at no charge.

      With a street address, the U.S. Post Office can give you the Zip+4 extended zip code.
      You can get that from this site :
      http://www.usps.com/zip4/

      With the 9 digit zip code you got from that site, this site will tell you what congresional district that address is in, and who represents it :
      http://www.house.gov/writerep/

      A directory of contact information for Representatives is here :
      http://clerk.house.gov/members/index.php
      (It can be sorted in a couple of different ways)

      All you need is a script that automates the process of looking up what you want to know ...

      (If you want to know how to contact your State's Senators, you can find thier contact info here :
      http://www.senate.gov/senators/index.cfm
      It can be sort in a few different ways too ... )

  4. so by austad · · Score: 2

    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
  5. Easy by benh57 · · Score: 4, Informative
    Using google I found this in about 30 seconds:

    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.

  6. Paranoid linux geeks by Jon+Peterson · · Score: 2

    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.

    --
    ----- .sig: file not found
  7. Why does everyone naturally assume spam? (ot) by a2800276 · · Score: 4, Insightful
    Why is it that the great majority of threads in this story follow the line:

    "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.

    1. Re:Why does everyone naturally assume spam? (ot) by ichimunki · · Score: 1

      It's fairly obvious that this guy wants to send mail to people. He said so. "Create mailings" is pretty clear. He apparently would like to be able to tailor the message according to which congressional district the recipient is in. So a likely case would be a PAC or political party that would like to send out a "sample ballot" or some other similar mailing. Which personally I'd roundfile in under five seconds... but yeah, what's the BFD?

      --
      I do not have a signature
  8. You're looking for TIGER Files by Anonymous Coward · · Score: 0

    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.

    1. Re:You're looking for TIGER Files by Profane+Motherfucker · · Score: 0, Troll

      You are indeed on sassy motherfucker -- and spot on. That's what this guy needs, you're correct. And this isn't a "Let's do it on Linux!!!!!!" bullshit solution. This is a fucking GIS issue. What the fucking database has to do with it is a mystery. Great, you want to limit yourself to one OS, one scripting language, and on DB, whatever. Fucking stupid if you ask me, but whatever.

      GRASS is a linux GIS program, but it won't do what he want easily, if at all. He needs ArcInfo with Spatial Analyist / ArcGrid. It runs on HP-UX, Solaris, Win2k, and a few others.

      That's a stupid fucking reason to *not* use a program -- just because there's 'an overabundance'. Well, they fucking work and if you want to get your shit done, use what works, not what's hip.

    2. Re:You're looking for TIGER Files by Dahan · · Score: 0, Offtopic

      Damn, you're a profane motherfucker!

    3. Re:You're looking for TIGER Files by Anonymous Coward · · Score: 0
      You're new here?

      Be careful or PMF will put the fucking kibosh on your ass.

  9. I don't have a Zip code... by Anonymous Coward · · Score: 0

    At least I won't have until the UK becomes the 52nd (or whatever) state...

  10. The UK situation by Bazzargh · · Score: 2

    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.

    1. Re:The UK situation by nelsonal · · Score: 2

      Our zip codes are fairly small there are at most 100,000 although we probably are not using all of them yet, most small towns have their own, and most larger cities have several, and there are only about 450 congressional districts, which range in size from a city, to whole states in the west, to my favorites the gerrymanders, which are districts created with the main purpose of ensuring that the party that does the redistricting gets the most seats in the house. Some of them are fairly interesting. One district, which was tossed out by a judge, got as narrow in parts as to not even include the entire width of a 4 lane divided highway. It was set up to include several towns along the highway, which would preserve a small majority of one of the parties in the entire district. Another common tactic, is creating a district that is overwhelmingly liberal or conservative, which allows you to make more districts that are slightly the opposite. Politics is a pretty funny game sometimes.

      --
      Degaussing scares the bad magnetism out of the monitor and fills it with good karma.
  11. Spam? by dacarr · · Score: 1

    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.
    1. Re:Spam? by austad · · Score: 2

      Notice I mentioned junk snail mail, however, I also mentioned spam, because if the spammer has your zip code and email address, they can send you spam which is targeted to you for the area you live in.

      --
      Need Free Juniper/NetScreen Support? JuniperForum
    2. Re:Spam? by Anonymous Coward · · Score: 0

      God forbid your representatives try to reach out to you and get your attention.

  12. Um...No by waldoj · · Score: 2

    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

  13. Generalize the Problem by bwt · · Score: 2

    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.

  14. TIGER Data by glitch_ · · Score: 2

    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

  15. Zip codes don't map neatly to political districts by markwelch · · Score: 2
    Bad news: my understanding is that congressional districts do not terminate along neat zip-code boundaries. At one time, my zip code was divided between TWO congressmen, TWO state senators, and THREE state assemblypersons. Thus, to do proper mapping, you need street-address level divisions or perhaps precinct maps. I would think that if you buy voter-registration data from the counties (states?) it would designate what district each voteris in.

    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
  16. Zip Locator by Anonymous Coward · · Score: 0

    ZipLoc a PHP class can be used in conjunction with the data provided on US gov census site?

  17. Re:Zip codes don't map neatly to political distric by Anonymous Coward · · Score: 0

    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.