The Scoop

  • Home
  • Projects
  • About The Scoop
  • Fixing Journalism
  • Medill Links
  • Departments
    • Apple
    • Asides
    • Broadcast
    • Campaign Finance
    • Car Tools
    • Data
    • DIY
    • django
    • Fed Data
    • FOIA
    • General
    • IRE
    • Journalism
    • Local Data
    • Mapping
    • Miscellany
    • NonGov Data
    • Online
    • Paper Trail
    • Presentations
    • Public Records
    • Python
    • Rails
    • SLA
    • Social Network Analysis
    • Sports
    • State Data
    • Teaching
    • Work
    • XML
  • Subscribe via RSS

Represent and GeoDjango

December 19th, 2008  |  Published in Work, django  |  8 Comments

For more details on Represent, see our post on the NYT’s Open blog.

Today (well, technically last night) at work we launched a beta Web application called Represent that helps New York City residents keep tabs on what their elected officials are doing. It’s the product of an idea that my colleague Andrei Scheinkman suggested when we sat down in the late Spring to kick around ideas for the Times’ internal technology challenge. We ended up being a finalist with our entry, which became the app you see today, thanks to design work by Stephan Weitberg and advice from a lot of folks.

Since Andrei and I both liked Python, and the contest asked for a working prototype, we built Represent using GeoDjango, the part of Django that makes spatial work easy enough that even I can manage it. This is my first time really dealing with GIS data, and probably the hardest part was getting all the dependencies installed the first time (after you do it once, the install becomes fairly routine, and on the latest Ubuntu version it’s simple).

So if you’re thinking about going the GeoDjango route, or trying it out, I’d offer these suggestions:

  • Go with Ubuntu Linux as your OS. It’s just easier. You can run GeoDjango on Windows, but I think I hate the Postgres Windows install and configure process more than just about anything I’ve tried to do on Windows.
  • When installing, do what the docs say. These are written by people who have already installed it. Once you start freelancing, your chance of success goes down dramatically.
  • Make sure that when you install Postgres, you test it out via the psql shell.
  • When in doubt, try the #geodjango IRC channel on FreeNode
  • When things just work, do not be surprised or await a message saying they worked.

Once you get GeoDjango installed – and it might take awhile the first time – you’ll be really impressed with how easy it is to use. I’ve written before about the power of LayerMapping, which is a huge gift to people who want to move from using Shapefiles to using GeoDjango. And there are other goodies, too, like the ability to plug into the GeoIP library to place your site visitors on a map (or configure their content based on that information). For Represent, we needed to produce KML files of each district that would display on the results pages. Turns out GeoDjango does that, too. To my eternal shame, I never really got the hang of working with Arc. Now I have a tool that suits me better.

Responses

Feed Trackback Address
  1. Ben says:

    December 19th, 2008 at 6:40 pm (#)

    For anyone struggling with the installation of GeoDjango’s dependencies, I would also recommend the guide provided by another product, GeoServer.

    http://geoserver.org/display/GEOSDOC/1.1.4+CentOS+(Red+Hat)+5.1+Install

    For me, the largest obstacle installation on production in CentOS was sorting out the GEOS_LIBRARY_PATH and GDAL_LIBRARY_PATH, which I now thing is covered in the GeoDjango docs.

    Nice work on Represent. Don’t stop now.

  2. Represent from nytimes.com gives New York City residents information about their elected representatives « Inside Online Journalism says:

    December 21st, 2008 at 8:06 am (#)

    [...] nytimes.com, and Derek Willis, a member of its web development group.  Derek Willis has written an interesting blogpost on Represent and GeoDjango — ‘…the part of Django that makes spatial work easy enough that even I [...]

  3. kevin says:

    December 21st, 2008 at 9:51 pm (#)

    Congrats on launching the site!

    I’d really love to see something like this employed locally. any ideas on furthering the application to locales outside of NYC?

  4. Strange Attractor » Blog Archive » links for 2008-12-23 says:

    December 23rd, 2008 at 7:30 am (#)

    [...] Represent and GeoDjango :: The Scoop Derek Willis, a member of the New York Times web development group, explains how to use GeoDjango to create the Represent project. All it took was Ubuntu, GeoDjango and some good design work. It's another argument for wise use of open source software. (tags: nytimes politics programming gis django ubuntu geodjango opensource) [...]

  5. Tim says:

    December 27th, 2008 at 9:26 am (#)

    Great stuff Derek!
    Note on Ubuntu from the GeoDjango site:
    The 8.04 (and lower) versions of Ubuntu use GEOS v2.2.3, which is incompatible with GeoDjango. Thus, do not use the binary packages for GEOS and/or PostGIS and build all prerequisites from source per the instructions in this document. It is okay to use the PostgreSQL binary packages.

  6. Tim says:

    December 29th, 2008 at 1:39 pm (#)

    about the last note, I upgraded from 8.04 to 8.10 and installation was a breeze.

  7. Rachel says:

    January 12th, 2009 at 6:21 pm (#)

    Congrats Derek (and Andrei)! ‘Represent’ is quite impressive indeed. This is just a quick response to Kevin’s question: “I’d really love to see something like this employed locally. any ideas on furthering the application to locales outside of NYC?” I actually work for a GIS software firm based in Philly. We have developed a tool that would enable something like ‘Represent’ to be employed locally. We call our tool Cicero, which is basically an address-based legislative district boundary and elected official Web Services and API. We have over 90 major American cities + Canada in the system, and our team updates the data on a regular basis (monthly and after each elections). It’s amazing the type of demand we’ve had for a tool like this! We certainly think Cicero could be used for an app as valuable as ‘Represent, at a local level: http://www.avencia.com/cicero We’ve never seen such an app though, so that’s a really interesting thought.

  8. “Represent” Beta » E-Demokratie, Internationales, Transparenz » E-Demokratie.org says:

    July 20th, 2009 at 3:50 pm (#)

    [...] ist eine nicht mehr ganz so neue aber dennoch sehr interessante Webapplikation der New York Times. Über die Verknüpfung von [...]

Leave a Response

Recent Comments

  • Miramon on No, Really, Show Us The Data
  • Washington Post: Print-Heads vs. Web-Heads | Reaction Radio on A Question of Emphasis
  • Chris Amico on Using Geocoders with GeoDjango
  • Derek on Using Geocoders with GeoDjango
  • Aaron on Using Geocoders with GeoDjango

Recent Posts

  • Using Geocoders with GeoDjango
  • The Gift of Data
  • The Future of IRE Training
  • Keeping It Simple(r)
  • A Question of Emphasis


©2010 The Scoop
Powered by WordPress using the Gridline Lite theme by Graph Paper Press.