Class: GeoScript::Geom::Point
- Includes:
- GeoScript::Geom
- Defined in:
- lib/geoscript/geom/point.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) ⇒ Point
constructor
A new instance of Point.
- #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) ⇒ Point
Returns a new instance of Point.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/geoscript/geom/point.rb', line 11 def initialize(*coords) if coords.first.kind_of? JTSPoint p = coords.first else c = Coordinate.new coords[0], coords[1] c.z = coords[2] if coords[2] p = GEOM_FACTORY.create_point c end super p.coordinate_sequence, GEOM_FACTORY end |
Instance Attribute Details
#bounds ⇒ Object
Returns the value of attribute bounds.
9 10 11 |
# File 'lib/geoscript/geom/point.rb', line 9 def bounds @bounds end |
Instance Method Details
#buffer(dist) ⇒ Object
22 23 24 |
# File 'lib/geoscript/geom/point.rb', line 22 def buffer(dist) Polygon.new super end |
#to_json ⇒ Object
34 35 36 |
# File 'lib/geoscript/geom/point.rb', line 34 def to_json IO.write_json self end |