Skip to content

Leg

Source code in docs_src/capo_location/types/leg.py
class Leg(TypedDict, closed=True):
    start_position: "capo_location.types.position.Position"
    """<p>The starting position of the leg. Follows the format <code>[longitude,latitude]</code>.</p> <note> <p>If the <code>StartPosition</code> isn't located on a road, it's <a href="https://docs.aws.amazon.com/location/previous/developerguide/snap-to-nearby-road.html">snapped to a nearby road</a>. </p> </note>"""
    end_position: "capo_location.types.position.Position"
    """<p>The terminating position of the leg. Follows the format <code>[longitude,latitude]</code>.</p> <note> <p>If the <code>EndPosition</code> isn't located on a road, it's <a href="https://docs.aws.amazon.com/location/previous/developerguide/nap-to-nearby-road.html">snapped to a nearby road</a>. </p> </note>"""
    distance: "capo_location.types.sensitive_double.SensitiveDouble"
    """<p>The distance between the leg's <code>StartPosition</code> and <code>EndPosition</code> along a calculated route. </p> <ul> <li> <p>The default measurement is <code>Kilometers</code> unless the request specifies a <code>DistanceUnit</code> of <code>Miles</code>.</p> </li> </ul>"""
    duration_seconds: "capo_location.types.sensitive_double.SensitiveDouble"
    """<p>The estimated travel time between the leg's <code>StartPosition</code> and <code>EndPosition</code>. The travel mode and departure time that you specify in the request determines the calculated time.</p>"""
    geometry: NotRequired["capo_location.types.leg_geometry.LegGeometry"]
    """<p>Contains the calculated route's path as a linestring geometry.</p>"""
    steps: "capo_location.types.step_list.StepList"
    """<p>Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.</p>"""

distance instance-attribute

distance: SensitiveDouble

The distance between the leg's StartPosition and EndPosition along a calculated route.

  • The default measurement is Kilometers unless the request specifies a DistanceUnit of Miles.

duration_seconds instance-attribute

duration_seconds: SensitiveDouble

The estimated travel time between the leg's StartPosition and EndPosition. The travel mode and departure time that you specify in the request determines the calculated time.

end_position instance-attribute

end_position: Position

The terminating position of the leg. Follows the format [longitude,latitude].

If the EndPosition isn't located on a road, it's snapped to a nearby road.

geometry instance-attribute

geometry: NotRequired[LegGeometry]

Contains the calculated route's path as a linestring geometry.

start_position instance-attribute

start_position: Position

The starting position of the leg. Follows the format [longitude,latitude].

If the StartPosition isn't located on a road, it's snapped to a nearby road.

steps instance-attribute

steps: StepList

Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.