amazonka-location-2.0: Amazon Location Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Location.Types.Leg

Description

 
Synopsis

Documentation

data Leg Source #

Contains the calculated route's details for each path between a pair of positions. The number of legs returned corresponds to one fewer than the total number of positions in the request.

For example, a route with a departure position and destination position returns one leg with the positions snapped to a nearby road:

  • The StartPosition is the departure position.
  • The EndPosition is the destination position.

A route with a waypoint between the departure and destination position returns two legs with the positions snapped to a nearby road:

  • Leg 1: The StartPosition is the departure position . The EndPosition is the waypoint positon.
  • Leg 2: The StartPosition is the waypoint position. The EndPosition is the destination position.

See: newLeg smart constructor.

Constructors

Leg' 

Fields

  • geometry :: Maybe LegGeometry

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

  • distance :: Double

    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.
  • durationSeconds :: Double

    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.

  • endPosition :: Sensitive (NonEmpty Double)

    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.

  • startPosition :: Sensitive (NonEmpty Double)

    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 :: [Step]

    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.

Instances

Instances details
FromJSON Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Generic Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Associated Types

type Rep Leg :: Type -> Type #

Methods

from :: Leg -> Rep Leg x #

to :: Rep Leg x -> Leg #

Show Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

showsPrec :: Int -> Leg -> ShowS #

show :: Leg -> String #

showList :: [Leg] -> ShowS #

NFData Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

rnf :: Leg -> () #

Eq Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

(==) :: Leg -> Leg -> Bool #

(/=) :: Leg -> Leg -> Bool #

Hashable Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

hashWithSalt :: Int -> Leg -> Int #

hash :: Leg -> Int #

type Rep Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

newLeg Source #

Create a value of Leg with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:geometry:Leg', leg_geometry - Contains the calculated route's path as a linestring geometry.

Leg, leg_distance - 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.

Leg, leg_durationSeconds - 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.

Leg, leg_endPosition - 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.

Leg, leg_startPosition - 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.

$sel:steps:Leg', leg_steps - 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.

leg_geometry :: Lens' Leg (Maybe LegGeometry) Source #

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

leg_distance :: Lens' Leg Double Source #

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.

leg_durationSeconds :: Lens' Leg Double Source #

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.

leg_endPosition :: Lens' Leg (NonEmpty Double) Source #

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.

leg_startPosition :: Lens' Leg (NonEmpty Double) Source #

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.

leg_steps :: Lens' Leg [Step] Source #

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.