]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/changeset.rb
i18n geocoder results
[rails.git] / app / models / changeset.rb
index a1162b3234be9dc0531cc9e85aa25115b77951c9..5c961a06470c1999d74df7565707559956811135 100644 (file)
@@ -89,6 +89,16 @@ class Changeset < ActiveRecord::Base
   def has_valid_bbox?
     not bbox.include? nil
   end
+  
+  ##
+  # returns area of the changset bbox as a rough comparitive quantity for use of changset displays
+  def area
+     if has_valid_bbox?
+            (max_lon - min_lon) * (max_lat - min_lat)
+     else
+            0
+     end
+  end
 
   ##
   # expand the bounding box to include the given bounding box. also,