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


343
344
345
346
347
348
349
350
351
352
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 343

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: []


338
339
340
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 338

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

#num_geometriesObject Also known as: size


333
334
335
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 333

def num_geometries
  @zgeometry.num_geometries
end