Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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
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 . TheEndPosition
is the waypoint positon. - Leg 2: The
StartPosition
is the waypoint position. TheEndPosition
is the destination position.
See: newLeg
smart constructor.
Leg' | |
|
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.
$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 aDistanceUnit
ofMiles
.
$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 aDistanceUnit
ofMiles
.
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.