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



330
331
332
333
334
335
336
337
338
339
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 330

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

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



325
326
327
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 325

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

#num_geometriesObject Also known as: size



320
321
322
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 320

def num_geometries
  @zgeometry.num_geometries
end