Class: GeoScript::Geom::MultiPoint

Inherits:
JTSMultiPoint
  • Object
show all
Includes:
GeoScript::Geom
Defined in:
lib/geoscript/geom/multipoint.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(*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

#boundsObject

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_jsonObject



43
44
45
# File 'lib/geoscript/geom/multipoint.rb', line 43

def to_json
  IO.write_json self
end

#to_wkbObject



39
40
41
# File 'lib/geoscript/geom/multipoint.rb', line 39

def to_wkb
  IO.write_wkb self
end

#to_wktObject



35
36
37
# File 'lib/geoscript/geom/multipoint.rb', line 35

def to_wkt
  IO.write_wkt self
end