@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Leg extends Object implements Serializable, Cloneable, StructuredPojo
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.
Constructor and Description |
---|
Leg() |
Modifier and Type | Method and Description |
---|---|
Leg |
clone() |
boolean |
equals(Object obj) |
Double |
getDistance()
The distance between the leg's
StartPosition and EndPosition along a calculated route. |
Double |
getDurationSeconds()
The estimated travel time between the leg's
StartPosition and EndPosition . |
List<Double> |
getEndPosition()
The terminating position of the leg.
|
LegGeometry |
getGeometry()
Contains the calculated route's path as a linestring geometry.
|
List<Double> |
getStartPosition()
The starting position of the leg.
|
List<Step> |
getSteps()
Contains a list of steps, which represent subsections of a leg.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setDistance(Double distance)
The distance between the leg's
StartPosition and EndPosition along a calculated route. |
void |
setDurationSeconds(Double durationSeconds)
The estimated travel time between the leg's
StartPosition and EndPosition . |
void |
setEndPosition(Collection<Double> endPosition)
The terminating position of the leg.
|
void |
setGeometry(LegGeometry geometry)
Contains the calculated route's path as a linestring geometry.
|
void |
setStartPosition(Collection<Double> startPosition)
The starting position of the leg.
|
void |
setSteps(Collection<Step> steps)
Contains a list of steps, which represent subsections of a leg.
|
String |
toString()
Returns a string representation of this object.
|
Leg |
withDistance(Double distance)
The distance between the leg's
StartPosition and EndPosition along a calculated route. |
Leg |
withDurationSeconds(Double durationSeconds)
The estimated travel time between the leg's
StartPosition and EndPosition . |
Leg |
withEndPosition(Collection<Double> endPosition)
The terminating position of the leg.
|
Leg |
withEndPosition(Double... endPosition)
The terminating position of the leg.
|
Leg |
withGeometry(LegGeometry geometry)
Contains the calculated route's path as a linestring geometry.
|
Leg |
withStartPosition(Collection<Double> startPosition)
The starting position of the leg.
|
Leg |
withStartPosition(Double... startPosition)
The starting position of the leg.
|
Leg |
withSteps(Collection<Step> steps)
Contains a list of steps, which represent subsections of a leg.
|
Leg |
withSteps(Step... steps)
Contains a list of steps, which represent subsections of a leg.
|
public List<Double> getStartPosition()
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.
[longitude,latitude]
.
If the StartPosition
isn't located on a road, it's snapped to a
nearby road.
public void setStartPosition(Collection<Double> 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.
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.
public Leg withStartPosition(Double... 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.
NOTE: This method appends the values to the existing list (if any). Use
setStartPosition(java.util.Collection)
or withStartPosition(java.util.Collection)
if you want
to override the existing values.
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.
public Leg withStartPosition(Collection<Double> 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.
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.
public List<Double> getEndPosition()
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.
[longitude,latitude]
.
If the EndPosition
isn't located on a road, it's snapped to a
nearby road.
public void setEndPosition(Collection<Double> 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.
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.
public Leg withEndPosition(Double... 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.
NOTE: This method appends the values to the existing list (if any). Use
setEndPosition(java.util.Collection)
or withEndPosition(java.util.Collection)
if you want to
override the existing values.
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.
public Leg withEndPosition(Collection<Double> 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.
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.
public void setDistance(Double 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
.
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
.
public Double getDistance()
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
.
StartPosition
and EndPosition
along a calculated
route.
The default measurement is Kilometers
unless the request specifies a
DistanceUnit
of Miles
.
public Leg withDistance(Double 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
.
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
.
public void setDurationSeconds(Double 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.
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.public Double getDurationSeconds()
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.
StartPosition
and EndPosition
. The
travel mode and departure time that you specify in the request determines the calculated time.public Leg withDurationSeconds(Double 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.
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.public void setGeometry(LegGeometry geometry)
Contains the calculated route's path as a linestring geometry.
geometry
- Contains the calculated route's path as a linestring geometry.public LegGeometry getGeometry()
Contains the calculated route's path as a linestring geometry.
public Leg withGeometry(LegGeometry geometry)
Contains the calculated route's path as a linestring geometry.
geometry
- Contains the calculated route's path as a linestring geometry.public List<Step> getSteps()
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.
public void setSteps(Collection<Step> 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.
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.public Leg withSteps(Step... 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.
NOTE: This method appends the values to the existing list (if any). Use
setSteps(java.util.Collection)
or withSteps(java.util.Collection)
if you want to override the
existing values.
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.public Leg withSteps(Collection<Step> 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.
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.public String toString()
toString
in class Object
Object.toString()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.