Encapsulates a set of lines, characterized by a sequence of Points in the xy-plane. It corresponds to the org.apache.cassandra.db.marshal.LineStringType column type in DSE.

See Also:

Inherits

Object

Includes

  • Cassandra::CustomData

Methods

self.

new

(*args)

Returns a new instance of LineString

Examples:
Construct an empty LineString
line = LineString.new
Construct a LineString with Point objects.
line = LineString.new(Point.new(1.0, 2.0), Point.new(3.0, 4.0))
Construct a LineString with a wkt string.
line = LineString.new('LINESTRING (1.0 2.0, 3.0 4.0)')
Parameters:
Name Type Details
args (Array<Point> or Array<String>) varargs-style arguments in two forms:
  • ordered collection of points that make up this line-string. Must be empty or have at least two points.
  • 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
LineString
Raises:
Type Details
Cassandra::Errors::DecodingError upon failure.

points

Returns collection of points that make up this line-string.

Returns:
Type Details
Array<Point> collection of points that make up this line-string.

wkt

Returns well-known-text representation of this line-string.

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

to_s

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

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

serialize

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

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