class GeoScript::Geom::MultiPolygon

Attributes

bounds[RW]

Public Class Methods

new(*polygons) click to toggle source
Calls superclass method
# File lib/geoscript/geom/multipolygon.rb, line 10
def initialize(*polygons)
  polys = []

  if polygons.first.kind_of? JTSMultiPolygon
    multi_polygon = polygons.first
    for i in range(0...multi_polygon.num_geometries)
      polys << multi_polygon.get_geometry_n(i)
    end
  else
    polygons.each do |polygon|
      if polygon.kind_of? Java::ComVividsolutionsJtsGeom::Polygon
        polys << polygon
      else
        polys << Polygon.new(*polygon)
      end
    end
  end
  super(polys.to_java(com.vividsolutions.jts.geom.Polygon), GEOM_FACTORY)
end

Public Instance Methods

buffer(dist) click to toggle source
Calls superclass method GeoScript::Geom::buffer
# File lib/geoscript/geom/multipolygon.rb, line 30
def buffer(dist)
  Polygon.new super
end
to_json() click to toggle source
# File lib/geoscript/geom/multipolygon.rb, line 42
def to_json
  IO.write_json self
end
to_wkb() click to toggle source
# File lib/geoscript/geom/multipolygon.rb, line 38
def to_wkb
  IO.write_wkb self
end
to_wkt() click to toggle source
# File lib/geoscript/geom/multipolygon.rb, line 34
def to_wkt
  IO.write_wkt self
end