Method: GeoRuby::SimpleFeatures::Polygon.from_coordinates

Defined in:
lib/geo_ruby/simple_features/polygon.rb

.from_coordinates(point_sequences, srid = DEFAULT_SRID, z = false, m = false) ⇒ Object

creates a new polygon. Accepts a sequence of points as argument:

((x,y)....(x,y)),((x,y).....(x,y))


158
159
160
161
162
# File 'lib/geo_ruby/simple_features/polygon.rb', line 158

def self.from_coordinates(point_sequences, srid = DEFAULT_SRID, z = false, m = false)
  polygon = new(srid, z, m)
  polygon.concat(point_sequences.map { |points| LinearRing.from_coordinates(points, srid, z, m) })
  polygon
end