Options
All
  • Public
  • Public/Protected
  • All
Menu

Formats points into GARS coordinate strings and parses GARS coordinate strings into points. GARS coordinates consist of cells, quadrants, and keypads, depending on the chosen precision.

Example use

  const format = new GARSPointFormat({
    precision: GARSPointFormatPrecision.KEYPAD
  });
  const garsString = format.format(10, 10);
  console.log(garsString);
  const lonLatPoint = format.parse(garsString);
  console.log(lonLatPoint);
since

2020.0.15

Hierarchy

  • GARSPointFormat

Overview

Constructors

Methods

Constructors

constructor

Methods

format

  • (pointOrLon: Point | number, lat?: number): string
  • Formats the given point or the given (lon,lat) pair as a GARS 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 GARS coordinate string to return a Point with WGS84 lon lat coordinates.

    Parameters

    • stringVal: string

      expects a GARS coordinate string as an argument

    Returns Point

    a Point with WGS84 lon lat coordinates.

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