Interactive NY redistricting map with cartoDB and more

UPDATE Nov. 5, 2012

In preparation for the Nov. 2012 election, many news organizations and others are linking to our interactive State Legislature and Congressional redistricting maps. We’ve posted examples at the Center for Urban Research website.


UPDATE Sept. 7, 2012

We’ve updated our map of redistricted State Senate and Assembly districts, highlighting the differences in race/ethnicity characteristics between total population and voter-eligible population – in other words, comparing the characteristics of all those who live in the new districts versus the smaller group who will be eligible to vote for each district’s representatives.  In some cases the differences are striking.

Our examination of the district-by-district data is available here.


New York State, like all other states, is in the midst of redrawing its legislative district lines. To help you follow along, our team at the Center for Urban Research has launched an interactive redistricting map for New York.  We collaborated with The New York World to develop the maps (though we encourage anyone and everyone to use them!).

The World’s reporters and editors are using our maps to go between the lines and explain how redistricting really works in the Empire State. (Here’s their first piece: The art of redistricting war.)  And we hope you’ll be able to use the maps too, to help answer questions such as:

  • Will you still be represented by the same State Senate or Assembly district you live in now?
  • Will you live in the newly proposed (and controversial) 63rd Senate district?
  • Is your neighborhood, town, or county going to be “carved up” by a new legislative seat?
  • Will your community’s historical voting power be diluted by the new districts?

We have some examples of gerrymandering at our Center’s website. In the meantime, here’s how you can use the maps.

Map features

The maps compare the current and proposed district lines (which our team mapped based on Census block lists published by the state’s redistricting task force, known as LATFOR). Here’s how they work:

  • Enter your address to find out what district currently represents you, and which proposed district you’d live in.
  • The current districts are on the left, and the proposed districts on the right.
  • You can also click on either map to highlight the current and proposed districts. As you move one map, the other moves in sync.
  • When you enter an address or click on the map, an info window pops up listing the current and proposed districts. You can click the link for the current district to go to that Senator or Assemblymember’s website.
  • Switch between State Senate and Assembly districts. Congressional districts will be posted once the data is available from LATFOR.
  • You can zoom in to street level, or zoom out to a statewide view. Switch between a street basemap or an aerial view from Microsoft’s Bing maps to see geographic details.

If you’re using the “Overlay” view, you can move the transparency slider to the right to display proposed districts, and to the left to fade back to current districts. The video below shows how:

If you want to share the map you’ve made, click the “Link” in the upper right of the map page to get a direct link to the area of the map you’re viewing. It will look like this:

http://www.urbanresearchmaps.org/nyredistricting/map.html?
lat=40.72852&lon=-73.99655&zoom=13&maptype=SIDEBYSIDE
&districttype=SENATE
  • You can share this on Twitter, Facebook, etc and email it to friends and colleagues.
  • You can also embed the map at your site. Use this link …
http://www.urbanresearchmaps.org/nyredistricting/map.html?output=embed
  • … or add < &output=embed > to any of the direct links you create, like this:
http://www.urbanresearchmaps.org/nyredistricting/map.html?
lat=40.72852&lon=-73.99655&zoom=13&maptype=SIDEBYSIDE
&districttype=SENATE&output=embed
  • … or wrap the snippet below in an iframe tag (I’d wrap it myself, but wordpress.com strips out iframe tags):
src="http://www.urbanresearchmaps.org/nyredistricting/map.html?output=embed" 
frameborder="0" marginwidth="0" marginheight="0" 
scrolling="no" width="600" height="700"

Side-by-side maps with OpenLayers

We borrowed from our “Census Comparinator” mapping site that Dave Burgoon artfully developed, in order to provide three ways to compare the current and proposed legislative districts:

  • a side-by-side view — two maps that are synced and move as one;
  • an overlay — a single map where you can fade between current and proposed districts; and
  • the vertical “before-and-after” slider approach.

I blogged about the Comparinator approach here and here. John Reiser also gave the technique a shoutout at his “Learning Web Mapping” blog for Rowan University.

With Census data, our “Comparinator” approach helped visualize changing spatial patterns of race/ethnicity trends – in cartographic terms, between two choropleth maps. With legislative districts, the comparison is between two sets of boundary files with no inner fill. So here we’ve set the side-by-side view as the default — we think the side by side maps give the easiest way of visualizing how the districts may change. But we also give you the option of viewing the districts with our vertical slider bar if you’d like, or the overlay.

Behind the scenes

For the proposed districts, we used ArcGIS to create the legislative district shapefiles based on LATFOR’s Census block assignment lists.  The current district boundaries are from the Census Bureau’s TIGER files (here’s the FTP page if you’d like to download the “lower” house districts — in New York, that’s the Assembly — or the “upper” house shapefiles — the State Senate).

We use OpenLayers for the map display and navigation with this application, as we’ve done with most of our other interactive maps. OpenLayers is easy to use, enables us to access Bing map tiles directly (so the basemap performance is smooth), and provides a robust JavaScript library for online maps.

That said, newer approaches such as Leaflet.js enable more interaction such as mouseovers, so we’ve started experimenting with some impressive new tools. More to follow!

One of those new tools is the powerful backend geospatial database engine from the team at Vizzuality: cartoDB. Hosting the legislative district shapefiles on cartoDB provided lots of advantages over hosting the data ourselves or setting up an Amazon cloud instance on our own. cartoDB provides:

  • great performance — not only for the district boundaries, but soon we’ll be adding election district maps to show voting patterns within each Senate and Assembly district. We don’t want to bother with creating pre-rendered tiles for this data. cartoDB will render it speedily on the fly.
  • cartographic flexibility: cartoDB uses cartoCSS for map symbology and labeling. Though there are still some quirks with cartoCSS, it was easy to grasp and it’s basically just CSS, so it makes styling easy if you’re familiar with modern web design. And cartoCSS incorporates scale-dependent rendering as well as attribute-based symbology, which makes it powerful and flexible. CartoCSS can be implemented using the cartoDB management interface, or programmatically.
  • easy data management: if you know SQL — and even better, if you’re familiar with SQL commands with PostGIS — you can quickly and easily modify tables, filter data, and perform spatial operations. (The screenshots at the cartoDB github page offer some examples.) Very cool.
  • scaling: cartoDB uses PostGIS and makes use of Amazon’s platform. So if our maps go viral, we’re ready for the usage spike!
  • open source: if you want to manage your own instance of cartoDB, just download the code and go! Big props to Vizzuality for an amazing geospatial toolkit.

Other thanks go to:

  • LATFOR, the state’s redistricting task force. Whatever you think about their redistricting process, they’ve done a great job with open data. They’ve not only posted the list of Census blocks that make up each proposed legislative district. But they also posted a wealth of data at the Census block level and also at the election district level (with a crosswalk between EDs and Census “voter tabulation districts”). This data is indispensable for visualizing, analyzing, and (hopefully) making sense of the new districts.
  • Dave Burgoon and the CUR team. Dave put together the redistricting mapping site in record time. Although it’s based on work he had already done with the Census Comparinator maps, it still involved substantial modifications and enhancements. But he made it happen as professionally and elegantly as always.
  • The New York World. We had been planning to create an interactive mapping application to build on our Census Comparinator site and to help people visualize the impacts of the redistricting process and demographic changes more broadly.  But the World team – Alyssa Katz, Michael Keller, and Sasha Chavkin – met with us a few weeks ago to discuss how we could collaborate on analyzing and mapping the upcoming district proposals from LATFOR.  The discussion inspired us to roll out a mapping site specific to New York State and focused on comparing the current and proposed districts. We’re thrilled to be able to work closely with them on this project (watch for more maps and data in the near future!).
  • The Hagedorn Foundation. The Foundation has provided funding support for our efforts to map and analyze Census data for a variety of civic engagement purposes, especially for Hagedorn’s Long Island-based grantees but also nationwide. Their support has been essential for us to develop innovative mapping applications like the NYS redistricting maps – not to advocate specific district plans one way or another, but to give local residents and others the tools they need to understand the impact of redistricting and hopefully get involved in the process.
About these ads

7 Responses

  1. quick question – you say:
    “LATFOR, the state’s redistricting task force. Whatever you think about their redistricting process, they’ve done a great job with open data. They’ve not only posted the list of Census blocks that make up each proposed legislative district.”

    When I clicked on the link I don’t see a section that posts the list of Census blocks that make up each new congressional district and actually I don’t even see a section for the proposed new congressional districts. Am I totally missing a section of LATFOR’s website?

  2. There is a vmdk virtual machine and a EC2 Amazon AMI available with CartoDB pre-installed:

    http://blog.lolo.asia/cartography/2012/06/11/cartodb-ec2-ami-vmdk-vm-available/

    so CartoDB can be tested locally or on the cloud.

  3. Where’d you get the 2012 state legislature district boundaries shp file? ftp2.census.gov/geo/tiger/TIGER2012/SLDL/ only list files with the old boundaries.

Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 1,532 other followers

%d bloggers like this: