Module: RGeo::Cartesian::PointMethods
- Included in:
- PointImpl
- Defined in:
- lib/rgeo/cartesian/feature_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#buffer(distance_) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/rgeo/cartesian/feature_methods.rb', line 32 def buffer(distance_) point_count_ = factory.property(:buffer_resolution) * 4 angle_ = -::Math::PI * 2.0 / point_count_ points_ = (0...point_count_).map do |i_| r_ = angle_ * i_ factory.point(@x + distance_ * ::Math.cos(r_), @y + distance_ * ::Math.sin(r_)) end factory.polygon(factory.linear_ring(points_)) end |