lib/terraformer/bounds.rb in terraformer-0.0.3 vs lib/terraformer/bounds.rb in terraformer-0.0.4
- old
+ new
@@ -31,12 +31,10 @@
raise ArgumentError.new 'unknown type: ' + obj.type
end
case format
when :bbox
- # yikes!
- bbox.extend BBox
bbox
when :polygon
Polygon.new [[bbox[0], bbox[1]],
[bbox[0], bbox[3]],
[bbox[2], bbox[3]],
@@ -53,18 +51,16 @@
bounds_for_array a, (nesting - 1), b
end
else
bbox = array.reduce box do |b, lonlat|
lon, lat = *lonlat
- set = ->(d, i, t){ b[i] = d if b[i].nil? or d.send(t, b[i]) }
+ set = ->(d, i, t){ b[i] = d if b[i].nil? or d.send(t, b[i])}
set[lon, X1, :<]
set[lon, X2, :>]
set[lat, Y1, :<]
set[lat, Y2, :>]
b
end
- # yikes!
- bbox.extend BBox
bbox
end
end
def bounds_for_feature_collection fc