TrackSegment
public struct TrackSegment : Hashable, Sendable
Value type describing a logical segment in a TrackGraph
. A TrackGraph
consists of a collection of TrackSegment
s. Each has a coordinate (latitude, longitude & elevation) and the distance (in meters) to its preceding segment point.
-
The
Coordinate
(latitude, longitude and elevation)Declaration
Swift
public var coordinate: Coordinate
-
Distance in meters to its preceding
TrackSegment
in aTrackGraph
Declaration
Swift
public var distanceInMeters: Double
-
Initializes a
TrackSegment
You don’t need to construct this value by yourself, as it is done by GXPKits track parsing logic.Declaration
Swift
public init(coordinate: Coordinate, distanceInMeters: Double)
Parameters
coordinate
A
Coordinate
struct, contains latitude/longitude and elevationdistanceInMeters
Distance in meters to its preceding
TrackSegment
in aTrackGraph