TomTom Maps for JavaScript
    Preparing search index...

    Type Alias CurveSectionProps

    CurveSectionProps: SectionProps & {
        curvinessScore: number;
        headingChangeInDegrees: number;
        lengthInMeters: number;
        maneuver?: Maneuver;
        radiusInMeters: number;
        severity: number;
    }

    A curve of a route: a stretch where the road keeps turning the same way.

    Type Declaration

    • curvinessScore: number

      How much the curve has to offer a rider, as roadcurvature.com scores roads: the length of its arc, radiusInMeters times the heading change in radians, with each metre counted:

      • 2 times below a radius of 30 m, 1.6 times below 60 m, 1.3 times below 100 m and 1 time below 175 m.
      • Not at all on a curve wider than 175 m, which scores 0.
    • headingChangeInDegrees: number

      How far the heading turns along the curve: positive to the right, negative to the left. It can pass 180° on a hairpin or a roundabout.

    • lengthInMeters: number

      The length of the curve, along the route, from where it starts turning to where it straightens.

    • Optionalmaneuver?: Maneuver

      The maneuver of the guidance instruction on the curve, such as TURN_LEFT or ROUNDABOUT_RIGHT. It tells a turn at a junction from a bend of the road, so it is absent:

      • On a curve no instruction falls on, or whose only instructions mark no junction: a departure, an arrival, a waypoint, a border or a tollgate.
      • Where the instruction keeps to the road, as "Turn left to stay on the SS38" where a side road leaves a hairpin, or has no other way to take, as "Follow the road to the left". A roundabout and a U-turn always name theirs.
      • On every curve of a route calculated without guidance.
    • radiusInMeters: number

      The radius of the circle the curve follows where it turns tightest, over the shortest part of it that turns four fifths of its heading change: a curve can ease in on a wide bend first.

    • severity: number

      How hard the curve is to drive, from 0 to 1: how much a driver slows down for it, from the speed limit on the road leading into it.

      • It grows as the radius shrinks. A shallow curve counts as wider than its radius, since a driver can straighten it out across the lane, but a hairpin can't be straightened.
      • A turn at a junction, with a turn, U-turn or roundabout maneuver, scores as one the driver slows right down for, however wide its corner is drawn.
      • It reads the route's speedLimit sections, so ask for them along with the curves. Where the route has no limit for the road, it takes a typical limit outside towns.
      • A curve a driver takes at the limit scores 0. The tighter the curve is for the road, the nearer 1 it scores.

    The SDK finds curves in the route's geometry, with getCurveSections. A small radius with a large heading change makes a hard curve: a hairpin turns some 180° on a radius of 10 to 20 metres.

    const hairpin: CurveSectionProps = {
    id: 'curve-1',
    startPointIndex: 120,
    endPointIndex: 131,
    headingChangeInDegrees: -172, // a left hairpin
    radiusInMeters: 14,
    lengthInMeters: 70,
    curvinessScore: 84, // each of the 42 metres of its arc counts twice
    severity: 0.94,
    };