District Finder API

The Problem

I can think of a handful of reasons a civic application would need to be able to look up various districts at the city, county, state, or national level. Also things like TIRZs. You should be able to provide a latlong or a county precinct number and have it return this data in a JSON/XML form for use in other applications.

Project

Backend interface, database, and end user API where the following can happen:

  1. Admins can upload a geojson, shapefile, etc. of voting precincts with an expiration date (usually they can only change at certain times by law).
  2. Admins can then upload the same for district/area/zone/whatever.
  3. Code runs to build a less intense to query database mapping the larger areas down to what precincts are in them.
  4. API users can make queries like /geo/precinct/29.7218989/-95.4562183 or /geo/county/29.7218989/-95.4562183
  5. JSON/XML spat out with known data, and a tag of some sort if it’s outdated according to the expiration set.

Why It’s Important

On it’s own, it’s not hugely important, but you could build all sorts of things with this data. Especially if the raw files were also provided somehow to download.

Off the top of my head, you could build the following:

  • Simple district listing interface: http://whatsmydistrict.org/
  • Who represents me, but like way more in depth: http://www.fyi.legis.state.tx.us/Home.aspx
  • A digital clone of a voter registration card like this: Texas voter registration card
  • A digital version of the League of Women Voters Voter Guide, but without showing you all the stuff you can’t actually vote for (the project I plan on doing next). For the primaries it was 51 pages. It took me 2 hours to get through, and at least half the time was just trying to find what was relevant to me.

What Are These Images?

After winning the 2016 Houston Hackathon, I had the chance to present my project to Mayor Turner. Presenting an API is not an easy thing to do, so I spend a few days cranking out a backend to demonstrate uploading and categorizing datasets, and then a frontend viewer to show getting data out and displaying it.

Project Details

Built: May 2016
Categories: Coding, Graphic Design, Interface Design
Tools: Cutestrap, Express, Grunt, Handlebars, Illustrator, PostGIS