Encapsulates a 2D point with x,y coordinates. It corresponds to the org.apache.cassandra.db.marshal.PointType column type in DSE.

See Also:

Inherits

Object

Includes

  • Cassandra::CustomData

Methods

self.

new

(*args)

Returns a new instance of Point

Examples:
Construct a Point with numeric arguments.
point = Point.new(3, 4)
Construct a Point with a wkt string.
point = Point.new('POINT (3.0 4.0)')
Parameters:
Name Type Details
args (Array<Numeric> or Array<String>) varargs-style arguments in two forms:
  • two-element numeric array representing x,y coordinates.
  • one-element string array with the wkt representation.
self.

type

Returns type of column that is processed by this domain object class.

Returns:
Type Details
Cassandra::Types::Custom type of column that is processed by this domain object class.
self.

deserialize

(data)

Deserialize the given data into an instance of this domain object class.

Parameters:
Name Type Details
data String byte-array representation of a column value of this custom type.
Returns:
Type Details
Point
Raises:
Type Details
Cassandra::Errors::DecodingError upon failure.

x

Returns the x coordinate of the point.

Returns:
Type Details
Float the x coordinate of the point.

y

Returns the y coordinate of the point.

Returns:
Type Details
Float the y coordinate of the point.

wkt

Returns well-known-text representation of this point.

Returns:
Type Details
String well-known-text representation of this point.

to_s

Returns a human-readable English string describing this Dse::Geometry::Point.

Returns:
Type Details
String a human-readable English string describing this Dse::Geometry::Point.

serialize

Serialize this domain object into a byte array to send to DSE.

Returns:
Type Details
String byte-array representation of this domain object.