Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to format points as MGRS or UTM/UPS coordinates.

This class offers methods to format coordinates into either UTM MGRS, UPS MGRS, UTM or UPS notation. The UTM MGRS and UTM notations are used for coordinates within the UTM latitude bounds. For points in the polar regions, outside the UTM latitude bounds, the UPS MGRS and UPS notations are used.

Example use

  const format = new MGRSPointFormat({
    formatType: MGRSPointFormat.Type.UTM_UPS,
    precision: MGRSPointFormat.Precision.PRECISION_1M
  });
  const mgrsString = format.format(10, 10);
  console.log(mgrsString);
  const lonLatPoint = format.parse(mgrsString);
  console.log(lonLatPoint);
since

2015.1

Hierarchy

  • MGRSPointFormat

Overview

Enumerations

Constructors

Methods

Constructors

constructor

Methods

format

  • (pointOrLon: Point | number, lat?: number): string
  • Formats the given point or the given (lon,lat) pair as an MGRS coordinate String. The point must be an instance of Point.

    Parameters

    • pointOrLon: Point | number

      point to be formatted or the longitude. When a point is used the reference of the point must be WGS84.

    • Optional lat: number

      the latitude, expressed in degrees (between -90 and 90), only required when the first argument is a longitude value.

    Returns string

    the formatted String.

parse

  • (stringVal: string): Point
  • Parses the given MGRS coordinate string into a Point with WGS84 lon lat coordinates.

    since

    2020.0.15

    Parameters

    • stringVal: string

      expects a MGRS coordinate string as an argument

    Returns Point

    the Point instance. The point uses WGS84 as its reference.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method