Module: RGeo::Geos::ZMGeometryCollectionMethods

Includes:
Enumerable
Included in:
ZMGeometryCollectionImpl, ZMMultiLineStringImpl, ZMMultiPointImpl, ZMMultiPolygonImpl
Defined in:
lib/rgeo/geos/zm_feature_methods.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#eachObject


327
328
329
330
331
332
333
334
335
336
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 327

def each
  if block_given?
    num_geometries.times do |i|
      yield geometry_n(i)
    end
    self
  else
    enum_for
  end
end

#geometry_n(n) ⇒ Object Also known as: []


322
323
324
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 322

def geometry_n(n)
  @factory.create_feature(nil, @zgeometry.geometry_n(n), @mgeometry.geometry_n(n))
end

#num_geometriesObject Also known as: size


317
318
319
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 317

def num_geometries
  @zgeometry.num_geometries
end