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

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

    Parameters

    • crs: string

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

    • x: number

      the X value.

    • y: number

      the Y value.

    • z: number

      the Z value.

    • is3D: boolean

      does the coordinate have a valid Z value?

    Returns Coordinate

Properties

crs: string

The EPSG CRS code, like "4326" for example

is3D: boolean

Does the coordinate have a valid Z value?

x: number

The X value

y: number

The Y value

z: number

The Z value

TYPE: string = "C"

The type of objects in this class

Methods

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

    Returns string

    a WKT string.

  • Make a copy of this coordinate.

    Returns Coordinate

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

    Returns string

    the string form of the object.

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

    Parameters

    • crs: string

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

    • x: number

      the X value.

    • y: number

      the Y value.

    Returns Coordinate

    the coordinate.

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

    Parameters

    • crs: string

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

    • x: number

      the X value.

    • y: number

      the Y value.

    • z: number

      the Z value.

    Returns Coordinate

    the coordinate.

  • Join a list of coordinates into a string.

    Parameters

    Returns string

    the string.