Module: GeoFoo::InstanceMethods
- Defined in:
- lib/geo_foo/active_record.rb
Instance Method Summary collapse
Instance Method Details
#point_to_coords ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/geo_foo/active_record.rb', line 40 def point_to_coords result = self.class.connection.execute( "SELECT ST_Y(point), ST_X(point) FROM #{self.class.table_name} " \ "WHERE id = #{self.id}" )[0] { :latitude => result["st_y"].to_f, :longitude => result["st_x"].to_f } end |