Accessing PostGIS spatial data from Rails

Posted by Lakitu on Stack Overflow See other posts from Stack Overflow or by Lakitu
Published on 2009-10-07T14:10:23Z Indexed on 2010/05/12 2:54 UTC
Read the original article Hit count: 275

Filed under:
|
|

I need to use an existing PostGIS database from my Rails application. So far I am able to access the DB just fine, GeoRuby nicely converts the 'geom' column into a Point object.

What I am looking for is an easy way to execute ActiveRecord-like queries on those tables, e.g.

Poi.find_within_radius(...)

or similar spatial queries like distance calculations et. al.

I tried several combinations of geokit, accompanying rails plugins but I'm quite sure there must be something better out there in the ruby/rails universe. Any hints?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about spatial