Class: GeoScript::Geom::LinearRing
- Inherits:
-
JTSLinearRing
- Object
- GeoScript::Geom::LinearRing
- Includes:
- GeoScript::Geom
- Defined in:
- lib/geoscript/geom/linearring.rb
Constant Summary
Constants included from GeoScript::Geom
Instance Attribute Summary collapse
-
#bounds ⇒ Object
Returns the value of attribute bounds.
Instance Method Summary collapse
- #buffer(dist) ⇒ Object
-
#initialize(*coords) ⇒ LinearRing
constructor
A new instance of LinearRing.
- #to_json ⇒ Object
- #to_wkb ⇒ Object
- #to_wkt ⇒ Object
Methods included from GeoScript::Geom
buffer, enhance, from_wkt, get_bounds, prepare, simplify, to_wkt
Constructor Details
#initialize(*coords) ⇒ LinearRing
Returns a new instance of LinearRing.
11 12 13 14 15 16 17 18 |
# File 'lib/geoscript/geom/linearring.rb', line 11 def initialize(*coords) if coords.size == 1 super(coords.first.coordinate_sequence) if coords.first.kind_of? LinearRing else line_string = LineString.new *coords super(line_string.coordinate_sequence, GEOM_FACTORY) end end |
Instance Attribute Details
#bounds ⇒ Object
Returns the value of attribute bounds.
9 10 11 |
# File 'lib/geoscript/geom/linearring.rb', line 9 def bounds @bounds end |
Instance Method Details
#buffer(dist) ⇒ Object
20 21 22 |
# File 'lib/geoscript/geom/linearring.rb', line 20 def buffer(dist) Polygon.new super end |
#to_json ⇒ Object
32 33 34 |
# File 'lib/geoscript/geom/linearring.rb', line 32 def to_json IO.write_json self end |