| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.Location.Types.Leg
Description
Synopsis
- data Leg = Leg' {
- geometry :: Maybe LegGeometry
- distance :: Double
- durationSeconds :: Double
- endPosition :: Sensitive (NonEmpty Double)
- startPosition :: Sensitive (NonEmpty Double)
- steps :: [Step]
- newLeg :: Double -> Double -> NonEmpty Double -> NonEmpty Double -> Leg
- leg_geometry :: Lens' Leg (Maybe LegGeometry)
- leg_distance :: Lens' Leg Double
- leg_durationSeconds :: Lens' Leg Double
- leg_endPosition :: Lens' Leg (NonEmpty Double)
- leg_startPosition :: Lens' Leg (NonEmpty Double)
- leg_steps :: Lens' Leg [Step]
Documentation
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
StartPositionis the departure position. - The
EndPositionis 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
StartPositionis the departure position . TheEndPositionis the waypoint positon. - Leg 2: The
StartPositionis the waypoint position. TheEndPositionis the destination position.
See: newLeg smart constructor.
Constructors
| Leg' | |
Fields
| |
Instances
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
Kilometersunless the request specifies aDistanceUnitofMiles.
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
Kilometersunless the request specifies aDistanceUnitofMiles.
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.