Giter VIP home page Giter VIP logo

whatsmydistrict's Introduction

What's My District?

See an example at whatsmydistrict.org.

Requirements

  • Ruby 1.9.3
  • postgresql -- brew install postgres
  • postgis -- brew install postgis

To get started:

  1. bundle

  2. puma to start the server at localhost:9292.

  3. For a new postgresql install in OS X:

     mkdir -p ~/Library/LaunchAgents
     cp /usr/local/Cellar/postgresql/9.2.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
     launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
     initdb /usr/local/var/postgres -E utf8
     pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    

    See also Postgres.app.

  4. Create the database: createdb -p 5432 -h localhost blake

  5. Add necessary postgis functions to the database: psql -p 5432 -h localhost -d blake -f /usr/local/share/postgis/postgis.sql and psql -p 5432 -h localhost -d blake -f /usr/local/share/postgis/spatial_ref_sys.sql -- thanks to PostGres - PostGIS on OS X Lion.

To update the database:

  1. Download the new shape file from data.lexingtonky.gov -- for example, under Community, Board of Elections - Voting Precincts.

  2. Run shp2pgsql -c -D -s 4269 -I shapefile.shp tablename > filename.sql. For example:

     $ shp2pgsql -c -D -s 4269 -I VotingPrecinct.shp voting > VotingPrecinct.sql
     Shapefile type: Polygon
     Postgis type: MULTIPOLYGON[2]
    
  3. In psql, drop the table you will be updating.

  4. Run psql -d database -f file.sql, for example psql -p 5432 -h localhost -d blake -f VotingPrecinct.sql.

whatsmydistrict's People

Contributors

chaserx avatar cheshire137 avatar blakeshall avatar ronnorthrip avatar

Watchers

James Cloos avatar Peter W avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.