Represents a track with various properties and methods to interact with it.

interface Track {
    dist: number;
    finish: LLA;
    gain: number;
    loss: number;
    points: Types.TrackPoint[];
    start: LLA;
    getLLA(location: number): LLA;
    reduceDensity(spacing?: number, length?: number): Types.Track;
}

Implemented by

Properties

dist: number

The total distance of the track in kilometers.

finish: LLA

The finishing location of the track.

gain: number

The total elevation gain of the track in meters.

loss: number

The total elevation loss of the track in meters.

points: Types.TrackPoint[]

An array of track points that make up the track.

start: LLA

The starting location of the track.

Methods

  • Gets the latitude, longitude, altitude, and index for a given distance location along the track.

    Parameters

    • location: number

      The distance location along the track.

    Returns LLA

    The latitude, longitude, and altitude at the specified location.

  • Reduces the density of track points based on the specified spacing and length.

    Parameters

    • Optionalspacing: number

      The desired spacing between points (optional).

    • Optionallength: number

      The desired length of the track (optional).

    Returns Types.Track

    A new track with reduced point density.