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