Class: GeoScript::Geom::MultiLineString
- Inherits:
-
JTSMultiLineString
- Object
- GeoScript::Geom::MultiLineString
- Includes:
- GeoScript::Geom
- Defined in:
- lib/geoscript/geom/multilinestring.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(*line_strings) ⇒ MultiLineString
constructor
A new instance of MultiLineString.
- #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(*line_strings) ⇒ MultiLineString
Returns a new instance of MultiLineString.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/geoscript/geom/multilinestring.rb', line 10 def initialize(*line_strings) strings = [] if line_strings.first.kind_of? JTSMultiLineString multi_line_string_geom = line_strings.first for i in range(0...multi_line_string_geom.num_geometries) strings << multi_line_string_geom.get_geometry_n(i) end else line_strings.each do |line_string| if line_string.kind_of? LineString strings << line_string else strings << LineString.new(*line_string) end end end super(strings.to_java(com.vividsolutions.jts.geom.LineString), GEOM_FACTORY) end |
Instance Attribute Details
#bounds ⇒ Object
Returns the value of attribute bounds.
8 9 10 |
# File 'lib/geoscript/geom/multilinestring.rb', line 8 def bounds @bounds end |
Instance Method Details
#buffer(dist) ⇒ Object
31 32 33 |
# File 'lib/geoscript/geom/multilinestring.rb', line 31 def buffer(dist) Polygon.new super end |
#to_json ⇒ Object
43 44 45 |
# File 'lib/geoscript/geom/multilinestring.rb', line 43 def to_json IO.write_json self end |