X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/64786faddf32c3dc328e64713d5b1c0945e7afcf..2d7e0a397a1b2dbed74f40439c1305b1b48a063e:/lib/bounding_box.rb?ds=inline diff --git a/lib/bounding_box.rb b/lib/bounding_box.rb index 0cc4c5fd4..462f45a9f 100644 --- a/lib/bounding_box.rb +++ b/lib/bounding_box.rb @@ -88,6 +88,14 @@ class BoundingBox end end + def linear_size + if complete? + (max_lon - min_lon) + (max_lat - min_lat) + else + 0 + end + end + def complete? to_a.exclude?(nil) end