Grid utilities

Hierarchy

  • GridUtils

Constructors

Methods

  • Get the tile bounds from the XYZ tile coordinates and zoom level

    Returns

    bounds

    Parameters

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns Bounds

  • Get the pixel where the point fits into the bounds

    Returns

    pixel

    Parameters

    • width: number

      width

    • height: number

      height

    • bounds: Bounds

      bounds

    • point: Point

      point

    Returns Pixel

  • Get the X pixel for where the longitude in meters fits into the bounds

    Returns

    x pixel

    Parameters

    • width: number

      width

    • bounds: Bounds

      bounds

    • longitude: number

      longitude in meters

    Returns number

  • Get the Y pixel for where the latitude in meters fits into the bounds

    Returns

    y pixel

    Parameters

    • height: number

      height

    • bounds: Bounds

      bounds

    • latitude: number

      latitude

    Returns number

  • Get the zoom level of the bounds using the shortest bounds side length

    Returns

    zoom level

    Parameters

    Returns number

  • Get the point intersection between end points of two lines

    Returns

    intersection point or null if no intersection

    Parameters

    • line1Point1: Point

      first point of the first line

    • line1Point2: Point

      second point of the first line

    • line2Point1: Point

      first point of the second line

    • line2Point2: Point

      second point of the second line

    Returns undefined | Point

  • Is the band letter an omitted letter GridConstants#BAND_LETTER_OMIT_I or GridConstants#BAND_LETTER_OMIT_O

    Returns

    true if omitted

    Parameters

    • letter: string

      band letter

    Returns boolean

  • Get the point intersection between two lines

    Returns

    intersection point or null if no intersection

    Parameters

    • line1: Line

      first line

    • line2: Line

      second line

    Returns undefined | Point

  • Get the precision value after the value

    Returns

    precision value

    Parameters

    • value: number

      value

    • precision: number

      precision

    Returns number

  • Get the precision value before the value

    Returns

    precision value

    Parameters

    • value: number

      value

    • precision: number

      precision

    Returns number

  • Get the tile size in meters

    Returns

    tile size

    Parameters

    • tilesPerSide: number

      tiles per side

    Returns number

  • Get the tiles per side, width and height, at the zoom level

    Returns

    tiles per side

    Parameters

    • zoom: number

      zoom level

    Returns number

  • Convert a coordinate from a unit to another unit

    Returns

    point in unit

    Parameters

    • fromUnit: Unit

      unit of provided coordinate

    • longitude: number

      longitude

    • latitude: number

      latitude

    • toUnit: Unit

      desired unit

    Returns Point

  • Convert a coordinate to the unit, assumes the coordinate is in the opposite unit

    Returns

    point in unit

    Parameters

    • longitude: number

      longitude

    • latitude: number

      latitude

    • unit: Unit

      desired unit

    Returns Point

Generated using TypeDoc