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


307
308
309
310
311
312
313
314
315
316
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 307

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


302
303
304
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 302

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

#num_geometriesObject Also known as: size


297
298
299
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 297

def num_geometries
  @zgeometry.num_geometries
end