A LineString is a one-dimensional object representing a sequence of points and the line segments connecting them.

Augments

  • Geometry

Members

Array<Point>

points

Returns a frozen Array of points that represent the line.

Constructor

new

LineString

([Point point])

Creates a new LineString instance.

Examples:
new LineString(new Point(10.99, 20.02), new Point(14, 26), new Point(34, 1.2));
Parameters:
Name Type Description
point optional variable Point

A sequence of Point items as arguments.

Methods

equals

(LineString other)

Returns true if the values of the linestrings are the same, otherwise it returns false.

Parameters:
Name Type Description
other LineString
Returns:
Type Description
Boolean

LineString.fromBuffer

(Buffer buffer)

Creates a LineString instance from a Well-known Text (WKT) representation of a line.

Static
This function is static
Parameters:
Name Type Description
buffer Buffer
Returns:
Type Description
LineString

LineString.fromString

(String textValue)

Creates a LineString instance from a Well-known Text (WKT) representation of a line.

Static
This function is static
Parameters:
Name Type Description
textValue String
Returns:
Type Description
LineString

toBuffer

()

Returns a Well-known Binary (WKB) representation of this instance.

Returns:
Type Description
Buffer

toJSON

()

Returns a JSON representation of this geo-spatial type.

toString

()

Returns Well-known text (WKT) representation of the geometry object.

Returns:
Type Description
String