Module: RGeo::Geos::ZMPolygonMethods
- Included in:
- ZMPolygonImpl
- Defined in:
- lib/rgeo/geos/zm_feature_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
- #area ⇒ Object
- #centroid ⇒ Object
- #coordinates ⇒ Object
- #exterior_ring ⇒ Object
- #interior_ring_n(idx) ⇒ Object
- #interior_rings ⇒ Object
- #num_interior_rings ⇒ Object
- #point_on_surface ⇒ Object
Instance Method Details
#area ⇒ Object
279 280 281 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 279 def area @zgeometry.area end |
#centroid ⇒ Object
283 284 285 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 283 def centroid @factory.create_feature(ZMPointImpl, @zgeometry.centroid, @mgeometry.centroid) end |
#coordinates ⇒ Object
313 314 315 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 313 def coordinates ([exterior_ring] + interior_rings).map(&:coordinates) end |
#exterior_ring ⇒ Object
291 292 293 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 291 def exterior_ring @factory.create_feature(ZMLineStringImpl, @zgeometry.exterior_ring, @mgeometry.exterior_ring) end |
#interior_ring_n(idx) ⇒ Object
299 300 301 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 299 def interior_ring_n(idx) @factory.create_feature(ZMLineStringImpl, @zgeometry.interior_ring_n(idx), @mgeometry.interior_ring_n(idx)) end |
#interior_rings ⇒ Object
303 304 305 306 307 308 309 310 311 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 303 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_rings ⇒ Object
295 296 297 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 295 def num_interior_rings @zgeometry.num_interior_rings end |
#point_on_surface ⇒ Object
287 288 289 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 287 def point_on_surface @factory.create_feature(ZMPointImpl, @zgeometry.centroid, @mgeometry.centroid) end |