Class UnitsUtils

Units utils contains methods to convert data between representations.

Multiple methods are used to reprent world coordinates based on the type of data being presented.

WGS84 is the most commonly used representation with (latitude, longitude, altitude).

EPSG:900913 is used for planar coordinates in (X, Y, Z)

Hierarchy

  • UnitsUtils

Constructors

Properties

EARTH_ORIGIN: number = ...

Earth equator perimeter in meters.

EARTH_PERIMETER: number = ...

Earth equator perimeter in meters.

EARTH_RADIUS: number = 6371008

Average radius of earth in meters.

EARTH_RADIUS_A: number = 6378137.0

Earth radius in semi-major axis A as defined in WGS84.

EARTH_RADIUS_B: number = 6356752.314245

Earth radius in semi-minor axis B as defined in WGS84.

Methods

  • Converts coordinates from WGS84 Datum to XY in Spherical Mercator EPSG:900913.

    Parameters

    • latitude: number

      Latitude value in degrees.

    • longitude: number

      Longitude value in degrees.

    Returns Vector2

  • Get a direction vector from WGS84 coordinates.

    The vector obtained will be normalized.

    Returns

    Direction vector normalized.

    Parameters

    • latitude: number

      Latitude value in degrees.

    • longitude: number

      Longitude value in degrees.

    Returns Vector3

  • Converts quad tree zoom/x/y to lat/lon in WGS84 Datum.

    The X and Y start from 0 from the top/left corner of the quadtree up to (4^zoom - 1)

    Parameters

    • zoom: number

      Zoom level of the quad tree.

    • x: number

      X coordinate.

    • y: number

      Y coordinate.

    Returns Geolocation

  • Direction vector to WGS84 coordinates.

    Can be used to transform surface points of world sphere to coordinates.

    Returns

    WGS84 coordinates.

    Parameters

    • dir: Vector3

      Direction vector.

    Returns Geolocation

Generated using TypeDoc