lib/terraformer/geometry.rb in terraformer-0.0.6 vs lib/terraformer/geometry.rb in terraformer-0.0.7
- old
+ new
@@ -5,11 +5,11 @@
class Geometry < Primitive
extend Terraformer::Geometry::ClassMethods
MULTI_REGEX = /^Multi/
- attr_accessor :coordinates
+ attr_accessor :coordinates, :crs
def initialize *args
case
when args.length > 1
self.coordinates = Coordinate.from_array args
@@ -25,9 +25,10 @@
def to_hash *args
h = {
type: type,
coordinates: coordinates
}
+ h[:crs] = crs if crs
h[:bbox] = bbox if Hash === args.last and args.last[:include_bbox]
h
end
def to_mercator