Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Coordinate defines a spatial coordinate. It has a coordinate reference system (CRS) and can be 2D or 3D.

Hierarchy

  • Coordinate

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Coordinate(crs: string, x: float64, y: float64, z: float64, is3D: boolean): Coordinate
  • Create a new coordinate.

    Parameters

    • crs: string

      the EPSG CRS code, like "4326" for example.

    • x: float64

      the X value.

    • y: float64

      the Y value.

    • z: float64

      the Z value.

    • is3D: boolean

      does the coordinate have a valid Z value?

    Returns Coordinate

Properties

crs

crs: string

The EPSG CRS code, like "4326" for example

is3D

is3D: boolean

Does the coordinate have a valid Z value?

x

x: float64

The X value

y

y: float64

The Y value

z

z: float64

The Z value

Static TYPE

TYPE: string = "C"

The type of objects in this class

Methods

asWKT

  • asWKT(): string
  • Convert to a WKT string.

    Returns string

    a WKT string.

toString

  • toString(): string
  • Convert the object to a string.

    Returns string

    the string form of the object.

Static fromXY

  • fromXY(crs: string, x: float64, y: float64): Coordinate
  • Create a new 2D coordinate.

    Parameters

    • crs: string

      the EPSG CRS code, like "4326" for example.

    • x: float64

      the X value.

    • y: float64

      the Y value.

    Returns Coordinate

    the coordinate.

Static fromXYZ

  • fromXYZ(crs: string, x: float64, y: float64, z: float64): Coordinate
  • Create a new 3D coordinate.

    Parameters

    • crs: string

      the EPSG CRS code, like "4326" for example.

    • x: float64

      the X value.

    • y: float64

      the Y value.

    • z: float64

      the Z value.

    Returns Coordinate

    the coordinate.

Static join

  • Join a list of coordinates into a string.

    Parameters

    Returns string

    the string.