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



253
254
255
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 253

def area
  @zgeometry.area
end

#centroidObject



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

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

#coordinatesObject



287
288
289
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 287

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

#exterior_ringObject



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

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

#interior_ring_n(n_) ⇒ Object



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

def interior_ring_n(n_)
  @factory._create_feature(ZMLineStringImpl, @zgeometry.interior_ring_n(n_), @mgeometry.interior_ring_n(n_))
end

#interior_ringsObject



277
278
279
280
281
282
283
284
285
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 277

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



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

def num_interior_rings
  @zgeometry.num_interior_rings
end

#point_on_surfaceObject



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

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