GPXTrack

public struct GPXTrack : Hashable, Sendable

A value describing a track of geo locations. It has the recorded TrackPoints, along with metadata of the track, such as recorded date, title, elevation gain, distance, height-map and bounds.

  • Declaration

    Swift

    public struct Segment : Hashable, Sendable
  • Optional date stamp of the gpx track

    Declaration

    Swift

    public var date: Date?
  • Waypoint defined for the gpx

    Declaration

    Swift

    public var waypoints: [Waypoint]?
  • Title of the gpx track

    Declaration

    Swift

    public var title: String
  • Description of the gpx track

    Declaration

    Swift

    public var description: String?
  • Array of latitude/longitude/elevation stream values

    Declaration

    Swift

    public var trackPoints: [TrackPoint]
  • TrackGraph containing elevation gain, overall distance and the height map of a track.

    Declaration

    Swift

    public var graph: TrackGraph
  • The bounding box enclosing the track

    Declaration

    Swift

    public var bounds: GeoBounds
  • Keywords describing a gpx track

    Declaration

    Swift

    public var keywords: [String]
  • The Segment of the track. Contains at least one segment

    Declaration

    Swift

    public var segments: [Segment]
  • Initializes a GPXTrack.

    Declaration

    Swift

    public init(date: Date? = nil, waypoints: [Waypoint]? = nil, title: String, description: String? = nil, trackPoints: [TrackPoint], keywords: [String] = [], segments: [Segment]? = nil)

    Parameters

    date

    The date stamp of the track. Defaults to nil.

    waypoints

    Array of Waypoint values. Defaults to nil.

    title

    String describing the track.

    trackPoints

    Array of TrackPoints describing the route.

    keywords

    Array of Strings with keywords. Default is an empty array (no keywords).

  • Initializes a GPXTrack. You don’t need to construct this value by yourself, as it is done by GXPKits track parsing logic.

    Declaration

    Swift

    public init(date: Date? = nil, waypoints: [Waypoint]? = nil, title: String, description: String? = nil, trackPoints: [TrackPoint], keywords: [String] = [], elevationSmoothing: ElevationSmoothing = .segmentation(50), segments: [Segment]? = nil) throws

    Parameters

    date

    The date stamp of the track. Defaults to nil.

    waypoints

    Array of Waypoint values. Defaults to nil.

    title

    String describing the track.

    trackPoints

    Array of TrackPoints describing the route.

    keywords

    Array of Strings with keywords. Default is an empty array (no keywords).

    elevationSmoothing

    The ElevationSmoothing in meters for the grade segments. Defaults to segmentation(_:) with 50 meters.