Class: GeoRuby::SimpleFeatures::MultiPolygon

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

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object



95
96
97
98
99
# File 'lib/geojson.rb', line 95

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