Class: GeoRuby::SimpleFeatures::Polygon

Inherits:
Object
  • Object
show all
Defined in:
lib/geojson.rb

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object



74
75
76
77
78
# File 'lib/geojson.rb', line 74

def as_json(options = nil)
  coords = self.collect {|ring| ring.points.collect {|point| [point.x, point.y] } }
  {:type => "Polygon", 
    :coordinates => coords}.as_json(options)
end