Skip to content

CalculateRouteRequest

Source code in docs_src/capo_location/types/calculate_route_request.py
class CalculateRouteRequest(TypedDict, closed=True):
    calculator_name: "capo_location.types.resource_name.ResourceName"
    """<p>The name of the route calculator resource that you want to use to calculate the route. </p>"""
    departure_position: "capo_location.types.position.Position"
    """<p>The start position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>[longitude, latitude]</code>.</p> <ul> <li> <p>For example, <code>[-123.115, 49.285]</code> </p> </li> </ul> <note> <p>If you specify a departure that's not located on a road, Amazon Location <a href="https://docs.aws.amazon.com/location/previous/developerguide/snap-to-nearby-road.html">moves the position to the nearest road</a>. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p> </note> <p>Valid Values: <code>[-180 to 180,-90 to 90]</code> </p>"""
    destination_position: "capo_location.types.position.Position"
    """<p>The finish position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>[longitude, latitude]</code>.</p> <ul> <li> <p> For example, <code>[-122.339, 47.615]</code> </p> </li> </ul> <note> <p>If you specify a destination that's not located on a road, Amazon Location <a href="https://docs.aws.amazon.com/location/previous/developerguide/snap-to-nearby-road.html">moves the position to the nearest road</a>. </p> </note> <p>Valid Values: <code>[-180 to 180,-90 to 90]</code> </p>"""
    waypoint_positions: NotRequired[
        "capo_location.types.waypoint_position_list.WaypointPositionList"
    ]
    """<p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position. </p> <ul> <li> <p>For example, from the <code>DeparturePosition</code> <code>[-123.115, 49.285]</code>, the route follows the order that the waypoint positions are given <code>[[-122.757, 49.0021],[-122.349, 47.620]]</code> </p> </li> </ul> <note> <p>If you specify a waypoint position that's not located on a road, Amazon Location <a href="https://docs.aws.amazon.com/location/previous/developerguide/snap-to-nearby-road.html">moves the position to the nearest road</a>. </p> <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p> <p>If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p> </note> <p>Valid Values: <code>[-180 to 180,-90 to 90]</code> </p>"""
    travel_mode: NotRequired["capo_location.types.travel_mode.TravelMode"]
    """<p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. You can choose <code>Car</code>, <code>Truck</code>, <code>Walking</code>, <code>Bicycle</code> or <code>Motorcycle</code> as options for the <code>TravelMode</code>.</p> <note> <p> <code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p> <p> <code>Truck</code> is not available for Grab.</p> <p>For more details on the using Grab for routing, including areas of coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a> in the <i>Amazon Location Service Developer Guide</i>.</p> </note> <p>The <code>TravelMode</code> you specify also determines how you specify route preferences: </p> <ul> <li> <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p> </li> <li> <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p> </li> </ul> <p>Default Value: <code>Car</code> </p>"""
    departure_time: NotRequired["capo_location.types.timestamp.Timestamp"]
    """<p>Specifies the desired time of departure. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.</p> <ul> <li> <p>In <a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. For example, <code>2020–07-2T12:15:20.000Z+01:00</code> </p> </li> </ul>"""
    depart_now: NotRequired["capo_location.types.sensitive_boolean.SensitiveBoolean"]
    """<p>Sets the time of departure as the current time. Uses the current time to calculate a route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.</p> <p>Default Value: <code>false</code> </p> <p>Valid Values: <code>false</code> | <code>true</code> </p>"""
    distance_unit: NotRequired["capo_location.types.distance_unit.DistanceUnit"]
    """<p>Set the unit system to specify the distance.</p> <p>Default Value: <code>Kilometers</code> </p>"""
    include_leg_geometry: NotRequired[
        "capo_location.types.sensitive_boolean.SensitiveBoolean"
    ]
    """<p>Set to include the geometry details in the result for each path between a pair of positions.</p> <p>Default Value: <code>false</code> </p> <p>Valid Values: <code>false</code> | <code>true</code> </p>"""
    car_mode_options: NotRequired[
        "capo_location.types.calculate_route_car_mode_options.CalculateRouteCarModeOptions"
    ]
    """<p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p> <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>"""
    truck_mode_options: NotRequired[
        "capo_location.types.calculate_route_truck_mode_options.CalculateRouteTruckModeOptions"
    ]
    """<p>Specifies route preferences when traveling by <code>Truck</code>, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.</p> <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>"""
    arrival_time: NotRequired["capo_location.types.timestamp.Timestamp"]
    """<p>Specifies the desired time of arrival. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.</p> <note> <p>ArrivalTime is not supported Esri.</p> </note>"""
    optimize_for: NotRequired["capo_location.types.optimization_mode.OptimizationMode"]
    """<p>Specifies the distance to optimize for when calculating a route.</p>"""
    key: NotRequired["capo_location.types.api_key.ApiKey"]
    """<p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>"""

arrival_time instance-attribute

arrival_time: NotRequired[Timestamp]

Specifies the desired time of arrival. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.

ArrivalTime is not supported Esri.

calculator_name instance-attribute

calculator_name: ResourceName

The name of the route calculator resource that you want to use to calculate the route.

car_mode_options instance-attribute

car_mode_options: NotRequired[CalculateRouteCarModeOptions]

Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or tolls.

Requirements: TravelMode must be specified as Car.

depart_now instance-attribute

depart_now: NotRequired[SensitiveBoolean]

Sets the time of departure as the current time. Uses the current time to calculate a route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.

Default Value: false

Valid Values: false | true

departure_position instance-attribute

departure_position: Position

The start position for the route. Defined in World Geodetic System (WGS 84) format: [longitude, latitude].

  • For example, [-123.115, 49.285]

If you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a 400 RoutesValidationException error.

Valid Values: [-180 to 180,-90 to 90]

departure_time instance-attribute

departure_time: NotRequired[Timestamp]

Specifies the desired time of departure. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.

  • In ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. For example, 2020–07-2T12:15:20.000Z+01:00

destination_position instance-attribute

destination_position: Position

The finish position for the route. Defined in World Geodetic System (WGS 84) format: [longitude, latitude].

  • For example, [-122.339, 47.615]

If you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road.

Valid Values: [-180 to 180,-90 to 90]

distance_unit instance-attribute

distance_unit: NotRequired[DistanceUnit]

Set the unit system to specify the distance.

Default Value: Kilometers

include_leg_geometry instance-attribute

include_leg_geometry: NotRequired[SensitiveBoolean]

Set to include the geometry details in the result for each path between a pair of positions.

Default Value: false

Valid Values: false | true

key instance-attribute

key: NotRequired[ApiKey]

The optional API key to authorize the request.

optimize_for instance-attribute

optimize_for: NotRequired[OptimizationMode]

Specifies the distance to optimize for when calculating a route.

travel_mode instance-attribute

travel_mode: NotRequired[TravelMode]

Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. You can choose Car, Truck, Walking, Bicycle or Motorcycle as options for the TravelMode.

Bicycle and Motorcycle are only valid when using Grab as a data provider, and only within Southeast Asia.

Truck is not available for Grab.

For more details on the using Grab for routing, including areas of coverage, see GrabMaps in the Amazon Location Service Developer Guide.

The TravelMode you specify also determines how you specify route preferences:

  • If traveling by Car use the CarModeOptions parameter.

  • If traveling by Truck use the TruckModeOptions parameter.

Default Value: Car

truck_mode_options instance-attribute

truck_mode_options: NotRequired[CalculateRouteTruckModeOptions]

Specifies route preferences when traveling by Truck, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.

Requirements: TravelMode must be specified as Truck.

waypoint_positions instance-attribute

waypoint_positions: NotRequired[WaypointPositionList]

Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.

  • For example, from the DeparturePosition [-123.115, 49.285], the route follows the order that the waypoint positions are given [[-122.757, 49.0021],[-122.349, 47.620]]

If you specify a waypoint position that's not located on a road, Amazon Location moves the position to the nearest road.

Specifying more than 23 waypoints returns a 400 ValidationException error.

If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a 400 RoutesValidationException error.

Valid Values: [-180 to 180,-90 to 90]