X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1ceb4ab9ba10d97333414bf66ae2c9d553668903..c451aa915c7012faf85fb3e973da7b14c3329720:/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,