Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting Down To Earth: Geospatial Analysis With Rails

Getting Down To Earth: Geospatial Analysis With Rails

Presentation by Daniel Azuma from RailsConf 2012. Covers example implementations of geospatial projects in Ruby on Rails. For more info, see http://daniel-azuma.com/railsconf2012

Daniel Azuma

April 23, 2012

More Decks by Daniel Azuma

Other Decks in Programming


  1. Daniel Azuma Rails Developer since 2006 Author of RGeo and

    related gems Chief Architect at Pirq
  2. Our agenda Setting up a geospatial Rails app Project 1:

    Visualizing geo-activity Project 2: Timezone lookup for a location Further material available online
  3. Geospatial software stack libgeos — geometric algorithms libproj — coordinate

    projections PostGIS — spatial plugin for PostgreSQL RGeo — Ruby libraries
  4. We installed some software We created a Rails app as

    usual But there were a few more configs …and that’s it!
  5. Project 1 summary We created a model to hold location

    data We loaded a bunch of data into it We queried data within a map rectangle We visualized the data using a heatmap
  6. “I don’t even see the code anymore. All I see

    is point, polygon, circle…”
  7. Project 2 summary We created timezone and polygon models We

    loaded data from a shapefile We wrote queries for polygons containing a point, and intersecting a buffer. We further optimized queries by subdividing polygons