libZSservicesZSamazonka-locationZSamazonka-location
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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
Eq Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

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

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

Show Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

showsPrec :: Int -> Leg -> ShowS #

show :: Leg -> String #

showList :: [Leg] -> ShowS #

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 #

NFData Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

rnf :: Leg -> () #

Hashable Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

Methods

hashWithSalt :: Int -> Leg -> Int #

hash :: Leg -> Int #

FromJSON Leg Source # 
Instance details

Defined in Amazonka.Location.Types.Leg

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.

$sel:distance: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.

$sel:durationSeconds: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.

$sel:endPosition: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.

$sel:startPosition: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.