SpeedLimit

public struct SpeedLimit : Hashable

Represents the speed limit of the current road. Speed limits that are described as conditional can be time-dependent. For time-dependent speed limits, the HERE SDK internally reads the current device time and notifies only on speed limits that are currently active.

It is recommended to use SpeedLimit.effectiveSpeedLimitInMetersPerSecond(...) when an application does not offer dedicated speed limit indicators for other cases, such as weather-dependent speed limits.

  • Regular speed limit if available. In case of unbounded speed limit, the value is zero.

    Note: When following a route, then this value will depend on the selected transport mode. For other speed limits, like weather-dependent speed limits only the value as shown on the local road sign is provided. It may not be applicable to all transport modes. For tracking mode (without following a route), the VehicleProfile is ignored and only the speed limit from the local road sign is provided or the regular speed limit for a particular type of road or area like regular inner-city speed limits.

    Declaration

    Swift

    public var speedLimitInMetersPerSecond: Double?
  • A recommended speed limit that may not be indicated on the local road signs, but that serves to warn a driver that the road conditions may indicate a lower speed. Typically, the road condition is a curved road or a ramp but it may be due to a narrow road, narrow bridge, intersecting road, drainage dip, etc. In some cases, the advisory sign is on a different road than the one for which it applies (this can happen with ramps). In this case, the advisory speed is indicated for the road for which it is intended, even if the sign is further than 50 meters from the particular road.

    • Advisory speed signs due to construction are not included.
    • A speed value is published for advisory signs.

    A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

    Declaration

    Swift

    public var advisorySpeedLimitInMetersPerSecond: Double?
  • A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when there is snow on the road.

    A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

    Declaration

    Swift

    public var snowSpeedLimitInMetersPerSecond: Double?
  • A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when it is raining or there is water on the road.

    A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

    Declaration

    Swift

    public var rainSpeedLimitInMetersPerSecond: Double?
  • A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when the visibility decreases due to fog.

    A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

    Declaration

    Swift

    public var fogSpeedLimitInMetersPerSecond: Double?
  • A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when the visibility is optimal due to weather conditions.

    A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

    Note: This speed limit is conditioned by factors not expressed by the other ones. For example, it may be a time-related speed limit or a vehicle-related one.

    Declaration

    Swift

    public var optimalWeatherSpeedLimitInMetersPerSecond: Double?
  • A conditional speed limit as indicated on the local road signs. School zone signs are often placed to slow drivers before reaching an intersection where children are crossing.

    A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

    Declaration

    Swift

    public var schoolZoneSpeedLimitInMetersPerSecond: Double?
  • A conditional speed limit as indicated on the local road signs. Speed limit that is in effect considering the current local time provided by the device’s clock.

    Declaration

    Swift

    public var timeDependentSpeedLimitInMetersPerSecond: Double?
  • Creates a new instance.

    • Parameters

      • speedLimitInMetersPerSecond: Regular speed limit if available. In case of unbounded speed limit, the value is zero.

      Note: When following a route, then this value will depend on the selected transport mode. For other speed limits, like weather-dependent speed limits only the value as shown on the local road sign is provided. It may not be applicable to all transport modes. For tracking mode (without following a route), the VehicleProfile is ignored and only the speed limit from the local road sign is provided or the regular speed limit for a particular type of road or area like regular inner-city speed limits.

      • advisorySpeedLimitInMetersPerSecond: A recommended speed limit that may not be indicated on the local road signs, but that serves to warn a driver that the road conditions may indicate a lower speed. Typically, the road condition is a curved road or a ramp but it may be due to a narrow road, narrow bridge, intersecting road, drainage dip, etc. In some cases, the advisory sign is on a different road than the one for which it applies (this can happen with ramps). In this case, the advisory speed is indicated for the road for which it is intended, even if the sign is further than 50 meters from the particular road.
        • Advisory speed signs due to construction are not included.
        • A speed value is published for advisory signs.

      A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

      • snowSpeedLimitInMetersPerSecond: A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when there is snow on the road.

      A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

      • rainSpeedLimitInMetersPerSecond: A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when it is raining or there is water on the road.

      A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

      • fogSpeedLimitInMetersPerSecond: A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when the visibility decreases due to fog.

      A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

      • optimalWeatherSpeedLimitInMetersPerSecond: A conditional speed limit as indicated on the local road signs. The road speed limit that is in effect only when the visibility is optimal due to weather conditions.

      A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

      Note: This speed limit is conditioned by factors not expressed by the other ones. For example, it may be a time-related speed limit or a vehicle-related one.

      • schoolZoneSpeedLimitInMetersPerSecond: A conditional speed limit as indicated on the local road signs. School zone signs are often placed to slow drivers before reaching an intersection where children are crossing.

      A possible usage example can be to show an icon on the device’s screen containing both special speed limit value and a visual cue in order to warn the user about the conditional speed limit.

      • timeDependentSpeedLimitInMetersPerSecond: A conditional speed limit as indicated on the local road signs. Speed limit that is in effect considering the current local time provided by the device’s clock.

    Declaration

    Swift

    public init(speedLimitInMetersPerSecond: Double? = nil, advisorySpeedLimitInMetersPerSecond: Double? = nil, snowSpeedLimitInMetersPerSecond: Double? = nil, rainSpeedLimitInMetersPerSecond: Double? = nil, fogSpeedLimitInMetersPerSecond: Double? = nil, optimalWeatherSpeedLimitInMetersPerSecond: Double? = nil, schoolZoneSpeedLimitInMetersPerSecond: Double? = nil, timeDependentSpeedLimitInMetersPerSecond: Double? = nil)