What's My District? started off as a 2013 National Day of Civic Hacking project. It essentially allows anyone in Lexington, KY to input their address and find out all the different districts they are in, including schools, council districts, magistrate districts, etc.
It was a Sinatra app using convoluted PostGIS queries and a pain to deploy. With Mapbox releasing Turf.js, I, @blakeshall, decided to remake What's My District. This is the results. All client side, all static files, and can be deployed on GitHub. I'm even adding finding and showing the nearest hospital, library, post office, and fire station.
The end goal is to break the abstract logic into a small library with all city/county specific stuff in a lexington.js file. This way other cities can get a jump start building their own version.
Current Dependencies:
- Mapbox.js
- Turf.js
- jQuery (could probably be replaced easily)
- Handlebars.js
Use Python simple server from project root directory.
python -m SimpleHTTPServer
- load localhost:8000
- voila!
After merging pull-request into master,
git co master
git pull
git co gh-pages
git merge master
git push
- Download dataset(s) from Lexington's Open Data Catalog
- Extract .zip file
- Convert .shp to .geojson
- Add / replace geojson in
assets/data
Use gdal's ogre to convert .shp format to .geojson format.
e.g. ogr2ogr -f GeoJSON -t_srs crs:84 voting.geojson VotingPrecinct.shp
- There's a nice writeup by Ben Balter on how to do this on your mac.
- Or there this Ogre web client.
It's possible that the zip file is also the .shp file or can be treated as such.
Pull requests welcome! Please see our contribution guide.