Daves Redistricting App Help

How You Use It

A typical session looks like this after you launch the app:

How It Works

The application is a Silverlight control running in an ASP page in your browser. (You need Silverlight 2.0.)When you select a state, the app calls a web service that downloads all of the data you need for that state. Once the app has obtained the data, it never goes back to the server. The data includes:

All of the data, except partisan data, comes from the U.S. Census Bureau.

Note: A block group is a census designation that is a group of up to 4 census blocks. A census block is the smallest area used by the census bureau. Blocks and block groups do not exactly correspond to voting districts or precincts. A voting district is a designation determined by each state. All but a few states have given voting districts area information to the census bureau and they have computed statistics for those areas. In my application, some states now use voting districts; others still use block groups; and for some I provide both. The size of voting districts appear to vary considerably between states. For some states (e.g. Maryland) I find it harder to get the CDs to have nearly equivalent population, because the voting districts are so populous. For other, they appear very close in size to block groups. For conciseness, in this Help file I will use block to mean block group or voting district.

Note: The polygons and data for states are large and therefore will take time to download. For example, the block group shapefile for Texas is 7MB. Add in the rest of the polygons and data and the download for Texas is 13MB. (On my home DSL Texas it sometimes takes a little over 4 minutes to load.) For Washington State the total is 7MB.

Selecting a State and Number of CDs

The first thing you always need to do is to select a state, even if you will then load a file you saved before. Selecting the state locates the directory where any saved files for that state are located.

Unless you are loading a saved file, use the #CDs slider control to selected the number of CDs you want to create. When you change the number of CDs, any blocks you have already assigned are cleared. You can create up to 500, which allows the tool to be used to create legislative districts, too. (There's currently no provision for loading the old LD polygons.)

CD Panel

On the left side of the window, under the Pan control, is a panel that contains CD information. Each row contains (1) the number of the CD; (2) a radial button, embedded in the CD's color, used to selected the CD; (3) the total population of all the block groups you have put into the CD; and (4) the deviation of the population from the average. The row labeled Un represents all of the unassigned block groups.

When you select a CD, the Info Bar at the bottom of the window shows the CD's population demographics, both number of persons and percentage. (Median Income is not yet calculated.)

File Menu

The File Menu allows you to save and reload your work across sessions.

Saved Files

Silverlight runs in a sandbox, so it only allows saving into isolated storage, which is a path of garbage directory names under an application local storage directory. When you save your work (.drf.xml) or map files (.map.xml) they go into this isolated storage. Also, the application stores all of the data files for a state that are uploaded from the server in local storage, so you will get faster loads on subsequent times you work on a state. The data can be quite large for large states.

 On Windows, isolated storage is in hidden folders, so you need to tell Windows to "Show Hidden Folders" (from Folder Options) to see them.

You shouldn't need to access the .drf.xml files unless you're curious, but to create JPGs, you'll need to find the .map.xml files. (See Maps below.)

The first time you save, a Silverlight dialog box will ask you to approve some 40 or 50 MB for isolated storage. The app asks for a bunch because the data files from the server and .map.xml files can be large (they have polygons) and by grabbing a bunch of space the application doesn't have to ask again for a while.

The .drf.xml stands for "daves redistricting file" and is simple XML to save your work. It does not contain any state information that is loaded from the server.

The .map.xml is an XML file that contains all polygons (counties, cities, etc.) needed by the Show settings for any state or area map. For each map, there is an indication of which Show settings apply to that map. Also, for each area map pan/zoom information is included.

New Population Estimates

The base data for the app is the 2000 census data. When you select the Use New Pop Est check box, the app uses newer population estimates. Currently these are 2008 estimates, broken down by county and by ethnicity, from the U.S. Census Bureau. The app distributes the population across all blocks in each county commensurate to the population of the blocks.

Find Next Unassigned

Sometimes you may think you've assigned every block to some CD, but the Unassigned population is still non-zero. That means some block is still unassigned. (Some can very small and easy to miss.) The Find Next Unassigned button cycles through all unassigned blocks, panning and zooming to them, to help you find them.

Assign Old CDs

Click this button and the tool will assign all blocks to CDs, putting each in the old CD that it was part of. This is a slow operation because it does "hit testing" on every block, which determines which Old CD polygon covers the block polygon. (Before 7/26/2009 the slow part of this occurred when loading the data instead of when you click the button.)

Along the edges of the old CDs, some blocks will sometimes be incorrectly assigned or cannot be split as they are in the old CDs. Remember, the tool uses block groups, which are a little larger than the blocks that were used for redistricting in 2000. The tool uses the center of the block provided by the Census Bureau (or center of the bounding box if the bureau gave us (0,0)) and then uses Silverlight's hit testing to find the old CD polygon that the point is in.


The Show section allows you to hide or show county, city or old CD boundaries and names, or new CD names. The Selected Old and New CD check box shows the old and new CD boundaries for the selected CD only.


In the Area Maps section, the Create button creates a map of the current zoomed in area with the current Show choices. You can create up to 50 of these. The Goto Next button allows you to cycle through all area maps. The Goto State Map button returns you to the state map (positioned and zoomed where you last left it). The Delete button deletes the current area map.

The Save Maps button saves the state map, if the State Map check box is checked, and all of the area maps, if the Area Maps button is checked. All are saved to a single .map.xml file named by the Filename text box next to the Save Maps button. If no name is specified, the saved file will be <file>.map.xml, where <file>.drf.xml is the current opened .drf.xml file. The file is saved in the isolated storage directory for the selected state. This file can be read by Map2JPG.exe and then saved as a set of JPGs, one for each area map and one for the state map.

An alternative to using Map2JPG.exe to get picture files is to use Print Screen to capture the desired images and then use your favorite photo editor (even Paint) to trim and save into a JPG or whatever.

Note: the map.xml files are currently looking really bad. It's recommended to use the "Print Screen" alternative all the time.

Known Issues

Changes and Fixed Bugs

Partisan Data

Partisan data, specifically 2008 presidential data, is now supported by the application. See the LaunchApp page for a list of which states are currently supported and which require "Use Test Data."


The voting districts shapes and population data come from the 2000 census. Many states changed their voting districts between 2000 and 2008, so the 2008 presidential data does not match completely. For Maryland, for example, over 200 new voting districts were created during that time, so only 1600 of 1800 match the 2000 districts. The application lets you know when this happens and then imply ignores the new districts. This could be improved if someone is able to merge the new districts data back into the old districts.

 All states that the Census Bureau provides voting district shapes for, except New York, now support voting districts in the application.

Help Get More Partisan Data

Find out more about partisan data and how you can help get more into the application here.


 Map2JPG.exe is a simple Window Presentation Foundation application that reads a .map.xml file and creates from it JPGs of the maps. It requires Microsoft .NET 3.5. It has a control to open and a second to save the JPGs. The open dialog attempts to put you on the directory path for isolated storage. In the best case you'll still need to navigate through a few junk directory names.

When you open a separate window is created with the state map. If you resize otherwise manipulate this window, it will change the resulting JPGs that will be output, so this is not recommended.

When you save you select a single filename. Then a set of files is created. The state map is <filename>-state.jpg; area maps are <filename>-area<1,2,...>.jpg.