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(n_) ⇒ Object
- #interior_rings ⇒ Object
- #num_interior_rings ⇒ Object
- #point_on_surface ⇒ Object
Instance Method Details
#area ⇒ Object
253 254 255 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 253 def area @zgeometry.area end |
#centroid ⇒ Object
257 258 259 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 257 def centroid @factory._create_feature(ZMPointImpl, @zgeometry.centroid, @mgeometry.centroid) end |
#coordinates ⇒ Object
287 288 289 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 287 def coordinates ([exterior_ring] + interior_rings).map(&:coordinates) end |
#exterior_ring ⇒ Object
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_rings ⇒ Object
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_rings ⇒ Object
269 270 271 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 269 def num_interior_rings @zgeometry.num_interior_rings end |
#point_on_surface ⇒ Object
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 |