Module: RGeo::Geos::ZMPolygonMethods

Included in:
ZMPolygonImpl
Defined in:
lib/rgeo/geos/zm_feature_methods.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#areaObject


293
294
295
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 293

def area
  @zgeometry.area
end

#centroidObject


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

def centroid
  @factory.create_feature(ZMPointImpl, @zgeometry.centroid, @mgeometry.centroid)
end

#coordinatesObject


327
328
329
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 327

def coordinates
  ([exterior_ring] + interior_rings).map(&:coordinates)
end

#exterior_ringObject


305
306
307
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 305

def exterior_ring
  @factory.create_feature(ZMLineStringImpl, @zgeometry.exterior_ring, @mgeometry.exterior_ring)
end

#interior_ring_n(n) ⇒ Object


313
314
315
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 313

def interior_ring_n(n)
  @factory.create_feature(ZMLineStringImpl, @zgeometry.interior_ring_n(n), @mgeometry.interior_ring_n(n))
end

#interior_ringsObject


317
318
319
320
321
322
323
324
325
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 317

def interior_rings
  result_ = []
  zrings_ = @zgeometry.interior_rings
  mrings_ = @mgeometry.interior_rings
  zrings_.size.times do |i_|
    result_ << @factory.create_feature(ZMLineStringImpl, zrings_[i_], mrings_[i_])
  end
  result_
end

#num_interior_ringsObject


309
310
311
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 309

def num_interior_rings
  @zgeometry.num_interior_rings
end

#point_on_surfaceObject


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

def point_on_surface
  @factory.create_feature(ZMPointImpl, @zgeometry.centroid, @mgeometry.centroid)
end