A Point is a zero-dimensional object that represents a specific (X,Y) location in a two-dimensional XY-Plane. In case of Geographic Coordinate Systems, the X coordinate is the longitude and the Y is the latitude.

Augments

  • Geometry

Members

Number

x

Returns the X coordinate of this 2D point.

Number

y

Returns the Y coordinate of this 2D point.

Constructor

new

Point

(Number x, Number y)

Creates a new Point instance.

Parameters:
Name Type Description
x Number

The X coordinate.

y Number

The Y coordinate.

Methods

equals

(Point other)

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

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

Point.fromBuffer

(Buffer buffer)

Creates a Point instance from a Well-known Text (WKT) representation of a 2D point.

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

Point.fromString

(String textValue)

Creates a Point instance from a Well-known Text (WKT) representation of a 2D point.

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

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