Class: OGR::GeometryCollection

Inherits:
Geometry
  • Object
show all
Defined in:
lib/ffi-ogr/geometry_collection.rb

Instance Attribute Summary

Attributes inherited from Geometry

#ptr

Class Method Summary collapse

Methods inherited from Geometry

#add_geometry, #add_geometry_directly, #add_point, create_empty, #flatten, #free, from_geojson, #get_area, #get_boundary, #get_envelope, #get_geometry_type, #get_length, #get_spatial_ref, #initialize, #is_3d?, release, #set_point, #to_geojson, #to_gml, #to_kml, #transform

Constructor Details

This class inherits a constructor from OGR::Geometry

Class Method Details

.create(geometries) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ffi-ogr/geometry_collection.rb', line 3

def self.create(geometries)
  geometry_collection = OGR::Tools.cast_geometry(FFIOGR.OGR_G_CreateGeometry(:geometry_collection))

  if geometries.size > 0
    geometries.each do |geometry|
      geometry_collection.add_geometry(geometry)
    end
  end

  geometry_collection
end