GeoRSS aggregator and Layar augmented reality server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

14 lines
253 B

  1. class Post < ActiveRecord::Base
  2. belongs_to :feed
  3. EARTH_RADIUS_M = 6378000
  4. def self.near(lat, lng, radius_m)
  5. all(
  6. :loc => {
  7. '$nearSphere' => [ lng, lat ],
  8. '$maxDistance' => radius_m / EARTH_RADIUS_M
  9. })
  10. end
  11. end