Friday, March 7, 2008

Geographic Analysis of Humboldt County's Hillary Smackdown

Posted By on Fri, Mar 7, 2008 at 7:32 PM

IMPORTANT UPDATE! See here .

eureka.png


Bill came , he saw, but he did not conquer. When election day rolled around, Barack Obama stomped Hillary Clinton in Humboldt County, 53-38.

That's just a piece of the story, though. The county's final precinct results, released Thursday, showed that Hillary Clinton was strong in some areas. Where? We made a little Google Earth map to show where.

The screenshot above shows the most divided town in the county: Eureka. Hillary is green, Barack is purple. The darker the color, the bigger the margin of victory against the principal rival. (Light white represents a tie vote -- you can see an example of it at the lower left.)

Click through for more pictures, a link to download the Google Earth overlay and a technical note for readers of a geeky bent.


fortuna.png


All told, it looks like Democrats in the more conservative and/or poorer areas of the county generally went with Clinton. Above is Fortuna, a Clinton Island adrift in a sea of Obamania. Rio Dell also went strong for Hillary.

hoopayurok.png


Also: Indian Country is Hillary Country. The square is the Hoopa Valley Reservation; the two big precincts to the northeast are dominated by the Yurok Reservation. Look at Orleans, to the right, though. Strong Obama!


One word of warning: These precincts, which are outlined in red, were consolidated in this election, as they are in most. I wasn't able to redraw the lines to take the consolidation into account. So if you see a precinct in dark green, it doesn't necessarily mean that that precinct went strong Hillary. It could mean that that precinct was wrapped up with a couple of other precincts, and taken together they all went strong Hillary. Clear?


Download the Google Earth .kmz file if you want to play with it yourself.

Technical Note: This whole project would have been a hell of a lot easier if I hadn't accidentally wiped my installation of PostGIS a couple of days ago. And it ain't so easy to get back, because my dpkg bug is flaring up again, and I'm waiting for the release of Ubuntu 8.04 to reinstall the OS. Anyways, if I hadn't eliminated my totally sweet, tuned PostGIS database with a stroke of the key, I could have dealt with the consolidated precincts issue in a heartbeat. Coloring the precincts would have been a lot easier, too. And I could have put a handy-dandy little clickable placemark at the center of each precinct, so you could click and get the raw vote.

But it was not to be. So I started off by using ogr2ogr reproject the county's elections precinct shapefile to WGS84 Lat/Long so's it'd play with Google Earth. Then I went ahead and used ogr2ogr to translate the shapefile to KML. Without my database, I had to manipulate the KML directly in order to color the polygons; for this, I used the excellent lxml library.

To get at the data, I scraped the county's final precinct results , which are only available in PDF. Then I scraped the Elections Department's Polling Locations PDF news release to figure out which precincts had been consolidated into which. I dumped all this into an SQLite database using the Django ORM. This wasn't actually as hard as I expected it to be.

And that was more or less that. A little Django/lxml script brought the pieces together.

  • Pin It
  • Favorite
  • Email

Tags:

Comments (16)

Showing 1-16 of 16

Add a comment

 
Subscribe to this thread:
Showing 1-16 of 16

Add a comment

About The Author

Hank Sims

more from the author

  • Cache Flow Problems

    Malfunction at cable Internet provider leads to stale Web pages, private information exposed
    • Feb 3, 2011
  • Hot Seats

    As the general plan update finish line looms nearer, upheaval over planning commission membership
    • Jan 27, 2011
  • Is Everybody HAPPY?

    • Jan 20, 2011
  • More »

Latest in News Blog

socialize

Facebook | Twitter

© 2024 North Coast Journal

Website powered by Foundation