Sha256: 7887808839d15f10945bc0549ce9fc2246a3d335887a7d46bfca1027afd031f1

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

java_import com.vividsolutions.jts.geom.Coordinate
JTSPoint = com.vividsolutions.jts.geom.Point

module GeoScript
  module Geom
    class Point < JTSPoint
      include GeoScript::Geom

      attr_accessor :bounds

      def initialize(*args);end

      def self.create(x, y = nil, z = nil)
        c = Coordinate.new x, y
        p = GEOM_FACTORY.create_point c
        point = Point.new p.coordinate_sequence, GEOM_FACTORY
        GeoScript::Geom.enhance point
        point
      end

      def to_wkt
        IO.write_wkt self
      end

      def to_wkb
        IO.write_wkb self
      end

      def to_json
        IO.write_json self
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geoscript-0.0.1.pre lib/geoscript/geom/point.rb