Inspiration
With the recent Supreme Court decision to reject the North Carolina state legislature's redistricting, we desired to inform and engage our fellow citizens with data visualizations and redistricting simulation.
What it does
Through mesh simplification with Bresenham's line algorithm, the app can compute and unionize complex shapefile MultiPolygons into a fishnetted vector space. This vertex simplicity creates an empowering experience for the user, in which the user can explore both how the system works, as well as how open it is to abuse. Gerry allows users and players to experience the realities of one of the most important (yet least understood) aspects of our political system.
How we built it
- Used Python to fishnet shapefile MultiPolygons
- Used past election data of U.S. representatives from the University of Michigan's Institute for Social Research to determine political alignments with district (including non-legislative) precision
- Used React and Redux to build the client-facing application
Challenges we ran into and Accomplishments that we're proud of
- The mesh simplification algorithm was by far our greatest hurdle. It required the use of Bresenham's line algorithm, an algorithm that determines the points of a raster in N-space that should be selected to form a close approximation to a straight line between two points.
- Due to the sheer size of shapefiles and the amount of MultiPolygons that needed processing, the algorithm required several hours of optimizing and mesh-precision tweaking
- Collecting data on representative elections took several hours of research
- Much of the React front-end had to be refactored to account for the innumerable amount of fishnetted cells that visualized a state/country.
- The precision setting on the mesh would sometimes create "holes" in whole columns or rows.
- MERGING! We only had Polygon shapes to the Congressional districts, and merging these districts into states, and then America, took a lot of whiteboarding and algorithm design.
What we learned
- Sometimes committing broken code is for the best. Our team member, Patrick Chan, learned this the hard way when he accidentally overwrote three hours of our mesh simplification algorithm with an earlier backup.


Log in or sign up for Devpost to join the conversation.