1 class GeoRecord < ActiveRecord::Base
2 before_save :update_tile
4 def self.find_by_area(minlat, minlon, maxlat, maxlon, options)
5 self.with_scope(:find => {:conditions => OSM.sql_for_area(minlat, minlon, maxlat, maxlon)}) do
6 return self.find(:all, options)
11 self.tile = QuadTile.tile_for_point(lat, lon)
15 self.latitude = (l * 10000000).round
19 self.longitude = (l * 10000000).round
23 return self.latitude.to_f / 10000000
27 return self.longitude.to_f / 10000000