Climb

public struct Climb : Hashable, Sendable

Describes a climb section within a track.

  • The distance in meters from the climbs start to the GPXTracks origin.

    Declaration

    Swift

    public var start: Double
  • end

    The distance of the end climb in meters from the GPXTracks origin.

    Declaration

    Swift

    public var end: Double
  • The elevation in meters of the climbs bottom.

    Declaration

    Swift

    public var bottom: Double
  • top

    The elevation in meters of the climbs top.

    Declaration

    Swift

    public var top: Double
  • The total elevation gain in meters of the climb. It may be higher than top - bottom when a climb has flat or descending sections.

    Declaration

    Swift

    public var totalElevation: Double
  • The average grade (elevation over distance) of the climb in percent in the range {0,1}.

    Declaration

    Swift

    public var grade: Double
  • The maximum grade (elevation over distance) of the climb in percent in the range {0,1}. If the climb was constructed from multiple adjacent climbs it has their maximum grade, otherwise maxGrade is equal to grade.

    Declaration

    Swift

    public var maxGrade: Double
  • The FIETS score of the climb

    One way to determine the difficulty of a climb is to use the FIETS formula to calculate a numeric value for the climb. This formula was developed by the Dutch cycling magazine Fiets. The formula is shown below:

    FIETS Score = (H * H / D * 10) + (T - 1000) / 1000
    

    Where:

    • H is the height of the climb (meters),
    • D is the climb length or distance (meters)
    • T is the altitude at the top (meters). The second term in the formula is only added when it is positive, that is, for climbs whose top is above 1000m. NOTE In GPXKit, the “(T - 1000)/1000” term of the FIETS formula is not added to the climb segments, so climbs can be joined together.

    Declaration

    Swift

    public var score: Double
  • Initializes a Climb.

    Declaration

    Swift

    public init(start: Double, end: Double, bottom: Double, top: Double, totalElevation: Double, grade: Double, maxGrade: Double, score: Double)

    Parameters

    start

    The distance in meters from the GPXTracks start.

    end

    The distance in meters from the GOXTrackss end.

    bottom

    The elevation in meters at the start of the climb.

    top

    The elevation in meters at the top of the climb.

    totalElevation

    The total elevation in meters of the climb (top - bottom in most cases).

    grade

    The grade (elevation over distance) of the climb in percent in the range {0,1}.

    maxGrade

    The maximum grade (elevation over distance) of the climb in percent in the range {0,1}.

    score

    The FIETS Score of the climb.

  • Initializes a Climb.

    Declaration

    Swift

    public init(start: Double, end: Double, bottom: Double, top: Double)

    Parameters

    start

    The distance in meters from the GPXTracks start.

    end

    The distance in meters from the GOXTrackss end.

    bottom

    The elevation in meters at the start of the climb.

    top

    The elevation in meters at the top of the climb.

  • The length in meters of the climb.

    Declaration

    Swift

    var distance: Double { get }