X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d23d2c9d05267b76a53058a5ee694a9fc677eb5a..3415aa468908abbc4c3c4787acb4ef05a0f73d53:/app/models/changeset.rb diff --git a/app/models/changeset.rb b/app/models/changeset.rb index a1162b323..5c961a064 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -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,