M OBILE C OMMONS Benjamin Stein  Legislative Lookup NYC.rb  January 13, 2009
<ul><li>Non-Profits & Activism </li></ul><ul><li>Politics & Government </li></ul><ul><li>Cultural Institutions </li></ul><...
<ul><li>Legislative lookup for advocacy call-in campaigns </li></ul><ul><li>Built into mConnect </li></ul><ul><li>Auto-rou...
Congressional Primer “ It’s just like the Galactic Senate, but on Earth”  --Mobile Commons CEO explaining the United State...
Requirements <ul><li>Lookup federal and state legislators by lat/lng </li></ul><ul><li>Need the office’s phone number </li...
DEMO
Build vs Buy <ul><li>Commercial services </li></ul><ul><li>Sunlight Foundation </li></ul><ul><li>Other free APIs </li></ul>
Rails 2.2 with Geo Plugins Spatial Adaptor for AR PostGIS Extensions ActiveRecord Postgres Database GeoRuby Models, Views,...
Database <ul><li>Postgres </li></ul><ul><ul><li>Why not MySQL?  </li></ul></ul><ul><ul><li>“ Bug #24659: GIS contains() us...
PostGIS <ul><li>Adds spatial objects to psql </li></ul><ul><li>Other important extensions: </li></ul><ul><ul><li>Proj4: re...
Give it Up For Open Source! <ul><li>Spatial Adapter </li></ul><ul><ul><li>Extend ActiveRecord to work with geometric colum...
CODE
M OBILE C OMMONS http://mcommons.com/developers http://congress.mcommons.com http://github.com/mcommons
Upcoming SlideShare
Loading in …5
×

NYC.rb Legislative Lookup

429 views
398 views

Published on

Benjamin Stein's presentation at the NYC.rb Ruby Meetup about Mobile Commons's open-source legislative lookup tool

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
429
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

NYC.rb Legislative Lookup

  1. 1. M OBILE C OMMONS Benjamin Stein Legislative Lookup NYC.rb January 13, 2009
  2. 2. <ul><li>Non-Profits & Activism </li></ul><ul><li>Politics & Government </li></ul><ul><li>Cultural Institutions </li></ul><ul><li>Healthcare </li></ul><ul><li>Donations </li></ul>Mobile Tools for Civic Engagement
  3. 3. <ul><li>Legislative lookup for advocacy call-in campaigns </li></ul><ul><li>Built into mConnect </li></ul><ul><li>Auto-route constituents to their legislators </li></ul>Motivation
  4. 4. Congressional Primer “ It’s just like the Galactic Senate, but on Earth” --Mobile Commons CEO explaining the United States government to the engineers
  5. 5. Requirements <ul><li>Lookup federal and state legislators by lat/lng </li></ul><ul><li>Need the office’s phone number </li></ul><ul><li>Geocoding out of scope </li></ul>
  6. 6. DEMO
  7. 7. Build vs Buy <ul><li>Commercial services </li></ul><ul><li>Sunlight Foundation </li></ul><ul><li>Other free APIs </li></ul>
  8. 8. Rails 2.2 with Geo Plugins Spatial Adaptor for AR PostGIS Extensions ActiveRecord Postgres Database GeoRuby Models, Views, Controllers YM4R/GM
  9. 9. Database <ul><li>Postgres </li></ul><ul><ul><li>Why not MySQL? </li></ul></ul><ul><ul><li>“ Bug #24659: GIS contains() uses MBR” </li></ul></ul><ul><ul><ul><li>http://bugs.mysql.com/bug.php?id=24659 </li></ul></ul></ul><ul><li>PostGIS </li></ul><ul><li>District Shapefiles </li></ul><ul><li>Shp2sql.rb </li></ul><ul><li>http://www.census.gov/geo/www/cob/bdy_files.html </li></ul>
  10. 10. PostGIS <ul><li>Adds spatial objects to psql </li></ul><ul><li>Other important extensions: </li></ul><ul><ul><li>Proj4: reprojection library </li></ul></ul><ul><ul><li>GEOS: support for topological tests, e.g. touches() and contains() </li></ul></ul><ul><li>Make your database GIS aware </li></ul><ul><ul><li>`psql -f lwgeom/lwpostgis.sql -d <your_database>` </li></ul></ul>
  11. 11. Give it Up For Open Source! <ul><li>Spatial Adapter </li></ul><ul><ul><li>Extend ActiveRecord to work with geometric columns </li></ul></ul><ul><li>GeoRuby </li></ul><ul><ul><li>classes that map to data types from spatial adaptor </li></ul></ul><ul><li>YM4R/GM </li></ul><ul><ul><li>Ruby interface for Google maps </li></ul></ul>
  12. 12. CODE
  13. 13. M OBILE C OMMONS http://mcommons.com/developers http://congress.mcommons.com http://github.com/mcommons

×