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


257
258
259
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 257

def area
  @zgeometry.area
end

#centroidObject


261
262
263
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 261

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

#coordinatesObject


291
292
293
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 291

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

#exterior_ringObject


269
270
271
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 269

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

#interior_ring_n(n) ⇒ Object


277
278
279
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 277

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

#interior_ringsObject


281
282
283
284
285
286
287
288
289
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 281

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


273
274
275
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 273

def num_interior_rings
  @zgeometry.num_interior_rings
end

#point_on_surfaceObject


265
266
267
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 265

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