Class: GeoRuby::SimpleFeatures::Polygon
- Inherits:
-
Object
- Object
- GeoRuby::SimpleFeatures::Polygon
- Defined in:
- lib/geojson.rb
Instance Method Summary collapse
Instance Method Details
#to_json(options = nil) ⇒ Object
74 75 76 77 78 |
# File 'lib/geojson.rb', line 74 def to_json( = nil) coords = self.collect {|ring| ring.points.collect {|point| [point.x, point.y] } } {:type => "Polygon", :coordinates => coords}.to_json() end |