calculate_routes
¶
calculate_routes(
destination: Position,
origin: Position,
*,
config_overrides: Optional[GeoRoutesClientConfig] = None,
allow: Optional[RouteAllowOptions] = None,
arrival_time: Optional[TimestampWithTimezoneOffset] = None,
avoid: Optional[RouteAvoidanceOptions] = None,
depart_now: Optional[SensitiveBoolean] = None,
departure_time: Optional[TimestampWithTimezoneOffset] = None,
destination_options: Optional[RouteDestinationOptions] = None,
driver: Optional[RouteDriverOptions] = None,
exclude: Optional[RouteExclusionOptions] = None,
instructions_measurement_system: Optional[MeasurementSystem] = None,
key: Optional[ApiKey] = None,
languages: Optional[LanguageTagList] = None,
leg_additional_features: Optional[RouteLegAdditionalFeatureList] = None,
leg_geometry_format: Optional[GeometryFormat] = None,
max_alternatives: Optional[int] = None,
optimize_routing_for: Optional[RoutingObjective] = None,
origin_options: Optional[RouteOriginOptions] = None,
span_additional_features: Optional[RouteSpanAdditionalFeatureList] = None,
tolls: Optional[RouteTollOptions] = None,
traffic: Optional[RouteTrafficOptions] = None,
travel_mode: Optional[RouteTravelMode] = None,
travel_mode_options: Optional[RouteTravelModeOptions] = None,
travel_step_type: Optional[RouteTravelStepType] = None,
waypoints: Optional[RouteWaypointList] = None,
) -> CalculateRoutesResponse
CalculateRoutes computes routes given the following required parameters: Origin and Destination.
For more information, see Calculate routes in the Amazon Location Service Developer Guide.
Parameters:
-
allow(Optional[RouteAllowOptions], default:None) –Features that are allowed while calculating a route. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
arrival_time(Optional[TimestampWithTimezoneOffset], default:None) –Time of arrival at the destination. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers.Time format:
YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mmExamples:
2020-04-22T17:57:24Z2020-04-22T17:57:24+02:00 -
avoid(Optional[RouteAvoidanceOptions], default:None) –Features that are avoided while calculating a route. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, it violates the avoidance and the returned response produces a notice for the violation. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyControlledAccessHighways,Ferries, andTollRoads -
depart_now(Optional[SensitiveBoolean], default:None) –Uses the current time as the time of departure.
-
departure_time(Optional[TimestampWithTimezoneOffset], default:None) –Time of departure from the origin.
Time format:
YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mmExamples:
2020-04-22T17:57:24Z2020-04-22T17:57:24+02:00 -
destination(Position) –The final position for the route. In the World Geodetic System (WGS 84) format:
[longitude, latitude]. -
destination_options(Optional[RouteDestinationOptions], default:None) –Destination related options. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
driver(Optional[RouteDriverOptions], default:None) –Driver related options. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
exclude(Optional[RouteExclusionOptions], default:None) –Features to be strictly excluded while calculating the route. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
instructions_measurement_system(Optional[MeasurementSystem], default:None) –Measurement system to be used for instructions within steps in the response.
-
key(Optional[ApiKey], default:None) –Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.
-
languages(Optional[LanguageTagList], default:None) –List of languages for instructions within steps in the response. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers.Instructions in the requested language are returned only if they are available.
-
leg_additional_features(Optional[RouteLegAdditionalFeatureList], default:None) –A list of optional additional parameters such as timezone that can be requested for each result. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyPassThroughWaypoints,Summary, andTravelStepInstructions-
Elevation: Retrieves the elevation information for each location. -
Incidents: Provides information on traffic incidents along the route. -
PassThroughWaypoints: Indicates waypoints that are passed through without stopping. -
Summary: Returns a summary of the route, including distance and duration. -
Tolls: Supplies toll cost information along the route. -
TravelStepInstructions: Provides step-by-step instructions for travel along the route. -
TruckRoadTypes: Returns information about road types suitable for trucks. -
TypicalDuration: Gives typical travel duration based on historical data. -
Zones: Specifies the time zone information for each waypoint.
-
-
leg_geometry_format(Optional[GeometryFormat], default:None) –Specifies the format of the geometry returned for each leg of the route. You can choose between two different geometry encoding formats.
FlexiblePolyline: A compact and precise encoding format for the leg geometry. For more information on the format, see the GitHub repository for https://github.com/aws-geospatial/polyline.Simple: A less compact encoding, which is easier to decode but may be less precise and result in larger payloads. -
max_alternatives(Optional[int], default:None) –Maximum number of alternative routes to be provided in the response, if available. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support only up to 3 alternative routes. -
optimize_routing_for(Optional[RoutingObjective], default:None) –Controls the trade-off between achieving the shortest travel time (
FastestRoute) and achieving the shortest physical distance ((ShortestRoute) when calculating each route in the matrix.Default value:
FastestRoute -
origin(Position) –The start position for the route in World Geodetic System (WGS 84) format: [longitude, latitude].
-
origin_options(Optional[RouteOriginOptions], default:None) –Specifies how the origin point should be matched to the road network and any routing constraints that apply when the traveler is departing the origin. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
span_additional_features(Optional[RouteSpanAdditionalFeatureList], default:None) –A list of optional features such as
SpeedLimitthat can be requested for a Span. A span is a section of a Leg for which the requested features have the same values. Not supported inap-southeast-1andap-southeast-5regions for GrabMaps customers. -
tolls(Optional[RouteTollOptions], default:None) –Toll related options. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
traffic(Optional[RouteTrafficOptions], default:None) –Traffic related options. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
travel_mode(Optional[RouteTravelMode], default:None) –Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyCar,Pedestrian, andScootervalues.Default value:
Car -
travel_mode_options(Optional[RouteTravelModeOptions], default:None) –Travel mode related options for the provided travel mode. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyCarandPedestriantravel mode options. -
travel_step_type(Optional[RouteTravelStepType], default:None) –Type of step returned by the response.
Defaultprovides basic steps intended for web based applications.TurnByTurnprovides detailed instructions with more granularity intended for a turn based navigation system. For GrabMaps customers,ap-southeast-1andap-southeast-5regionsDefaultdoes not return any steps. -
waypoints(Optional[RouteWaypointList], default:None) –List of waypoints between the Origin and Destination. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions max length is100.Max length:
23
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_geo_routes/_services/geo_routes.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | |