Class: GeoScript::Geom::LinearRing

Inherits:
JTSLinearRing
  • Object
show all
Includes:
GeoScript::Geom
Defined in:
lib/geoscript/geom/linearring.rb

Constant Summary

Constants included from GeoScript::Geom

GEOM_FACTORY, PREP_FACTORY

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#boundsObject

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_jsonObject



32
33
34
# File 'lib/geoscript/geom/linearring.rb', line 32

def to_json
  IO.write_json self
end

#to_wkbObject



28
29
30
# File 'lib/geoscript/geom/linearring.rb', line 28

def to_wkb
  IO.write_wkb self
end

#to_wktObject



24
25
26
# File 'lib/geoscript/geom/linearring.rb', line 24

def to_wkt
  IO.write_wkt self
end